Re: w32lib error?

new topic     » goto parent     » topic index » view thread      » older message » newer message
JoKeR said...

This showed me that the value used for pWidth is 26833 and for pHeight is 3556. This is consistent with what my own code told me it was passing to setRect() which then calls setCtlSize() which in turn calls createPixmap(). The program then dies with a divide by zero error as shown in this bit of the DOS window from it dying:

This code works until I try to use it with these large values, but this was working for the last several days, even on this large virtual window. The call to Win32Lib.ew which failed here is no different than it has been for the last few days.

Any ideas what is wrong here? Could my Vista box just be in need of rebooting? It looks like this is in the Windows function code that the divide is happening.

I'm not sure which version of win32lib you're using, but looking at createPixmap(), I find one call to warnErr():

        -- create a window sized bitmap compatible with the screen 
        handle = w32Func( xCreateCompatibleBitmap, { hdc, pWidth, pHeight } ) 
        -- release the dc 
        releaseDC( Screen ) 
 
        if handle = NULL then 
            warnErr( Err_CREATEPIXMAP ) 
        end if 
 

So it looks like windows didn't/couldn't create your pixmap. Those large values are pretty huge. I'm not sure what the maximum size for a pixmap is (or exactly how it's stored) but just multiplying width by height is over 95 million. You'd need to multiply by 8 or 16 or more, depending on the color depth, I'd guess (I'm assuming that pixmaps don't compress in memory, which seems like a pretty safe bet).

So you're talking hundreds of MBs to GBs, purely for memory to store the pixels. I suspect that you need contiguous memory in order to do that. There might not be enough contiguous blocks of RAM to do this. Or you could be hitting other constraints set by windows. You might try experimenting to see what the limits are.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu