Gary wrote:
> I actually am using that less-favored method, simply
> clipping the larger bitmap onto the screen, the screen
> being a "view" onto the bmp...
>
> ..I haven't run-into problems yet, but I'm still
> concerned about performance. Due to its inelegance, I
> want to "ding" the clipping method but when I consider
> "cropping" the image before the copy, I wonder which
> is less efficient!
Well, you don't have to crop before copying. Just create
an offscreen window out of the bitmap, then copy only
part of that window.
Anyway, these are the performance issues as far as I see them:
(1) Compressed bitmaps. You've got to uncompress it sometime.
If you need to draw it (or portions of it) repeatedly,
it's probably best to create an offscreen window (whose
contents will not be compressed by nature), then
WinCopyRectangle() it to that window, then WinCopyRectangle()
it to the screen when you want to draw.
(2) Color conversion. If your bitmap is in some format other
than what the screen is (you have 8-bit and the screen is
16-bit, for example), and if you draw the bitmap often,
then you want to create an offscreen window in the screen's
format (using the special flag for that purpose) and copy
from there.
But, since all those (if they happen at all) need to happen at
least once, then if you are drawing a bitmap only ONCE, it doesn't
seem like it would help you at all to create a screen-format
offscreen window (WinCreateOffscreenWindow()) rather than just
creating an offscreen window that "wraps" your existing bitmap
data (WinCreateBitmapWindow()). It seems like you'd have to
go through the same steps either way. Plus, presumably
WinCreateBitmapWindow() uses a lot less temporary memory.
- Logan
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/