jmanomega
10-27-2004, 02:50 PM
I was wondering if it takes more time to blt:
1 800x600 Bitmap
or
48 100x100 Bitmaps
or
192 50x50 Bitmaps
(all end up as 800x600)
And, if it is faster to blt 1 800x600 Bitmap, then is there a way to only blt a part of a larger bitmap(say a 800x600 section out of a 2000x2000)?
noi_max
10-27-2004, 03:33 PM
This is a good question... and I suppose it would depend on what you're doing.
I think blitting one large image would take less time than blitting many smaller images, if it were to happen in each iteration of say a game loop.
I have a scrolling map demo, where the final map surface is huge, but only a visible portion is blitted like you said, and only after the smaller tiles are already assembled.
http://www.xtremevbtalk.com/showthread.php?t=184577
Post # 6
Blt-ing many small blts almost always takes more time then one large one..
However, there are a couple ways that you can "even out" the differences:
1.) You can assembly (Bitblt together) all the small images/sprites/tiles together in a memoryDC backbuffer first, before "flipping" the backbuffer onto the screen (in a form or picturebox control) using Bitblt.
2.) You can use the LockWindowUpdate API to keep the form or picturebox control from updating (re-painting itself) during a series of Bitblt calls.
As regards to sectioning off a part of the picture, the Bitblt API allows for this using the correct dimensional parameters (X,Y values)