Skip to main content
gamedev.net
🔒 Locked

Scrolling large bitmaps

Started by Strategy Sep 13, 2000 at 1:43 PM 4 replies 400+ views
Original Post
Strategy
Strategy
I need to display a large bitmap (7500 x 3500) in a window, and have it scroll when the mouse reaches the edge of the screen (with super-imposed icons/bitmaps to show terrain features etc + the occasional animations). The current prototype implementation is done in VCL and works fine on my machine, but I want to optimize it to work on slower/less powerful machines. Any suggestions on doing this efficiently in BCB4?
turbo
turbo
Use DirectX for BLTing should speed things vs. the VCL. If you don''t want to use DX, try looking up DRAWDIB and some of the other DIB drawing commands that were introduced in Win95 and WinG.



[ turbo | turbo.gamedev.net ]
[ Michael Wilson | turbo sys-op | turbo.gamedev.net ]
Sly
Sly
A bitmap of that size would need to be loaded from disk in sections. If that one bitmap was in 24-bit colour, then 7500 pixels x 3500 pixels x 3 bytes per pixel = 75MB. That''s a lot of bitmap to load in one go and keep in memory.

I would suggest breaking the bitmap up into smaller, more manageable chunks. Say 256x256. Load each section as necessary and discard unneeded sections. That would be your most efficient solution.



Steve 'Sly' Williams
Tools Developer
Krome Studios
Strategy
Strategy
The bitmap is reduced to 8bit colours, which helps a lot (down to 24Mb only). Still plan to chop it into bits though.

Thanks for the help.

Edited by - strategy on September 18, 2000 7:08:04 AM
MButchers
MButchers
Hi there,

you can always create a DIB and stream the required data into
the color buffer from your graphics file.Doing this cuts down dramatically on memory usage but not much on speed as windows
uses its swap files on disk anyway.In fact I used this method
and performance was exactly the same.

Hope this idea may help.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.