Mostly I need to keep the window compressed so that it does not take up
large amounts of memory while I am working with it.

Thanks,
Donald

"Logan Shaw" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Donald C. Kirker wrote:
> > Does anyone have any suggestions?
> >
> > I have tried to retrieve the window's bitmap with WinGetBitmap and then
> > compressing the bitmap that it returns, but it seems that whenever I try
to
> > draw to it I get a fatal exception.
>
> There seem to be restrictions on what you can do with windows backed
> by compressed bitmaps.  For instance, the documentation for
> WinCopyRectangle() says this:
>
> If the destination bitmap is compressed, the mode parameter
> must be winPaint, and the destination coordinates must be (0,0).
> If the width of the destination rectangle is less than 16 pixels
> or if the destination coordinates are not (0,0), then this function
> turns off compression for the destination bitmap. Normally, you do
> not copy to a compressed bitmap. Instead, you copy to an
> uncompressed bitmap and compress it afterwards.
>
> To me, this implies that whatever routines draw to windows (and write
> to the underlying bitmaps) don't handle the general case.
>
> It seems like a valid sequence would be something like this:
>
> 1.  create offscreen bitmap, uncompressed.
> 2.  wrap with a window by using WinCreateBitmapWindow().
> 3.  do all the drawing you need to do.
> 4.  remove the window wrapping by doing WinDeleteWindow().
> 5.  call BmpCompress() on the resulting bitmap.
>
> This is not going to be suitable for all purposes, but it should
> work in cases where you want to create the bitmap and then leave
> it alone for some reason (like if you were drawing a map or
> something along those lines).
>
>    - Logan
>



-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to