Skip to main content
GameDev.net gamedev.net
🔒 Locked

BMP and memory

Started by fireking Sep 28, 2002 at 11:39 PM 2 replies 350+ views
Original Post
fireking
fireking
I was wondering, how can I find out how much memory a bitmap is using when loaded into a handle, and selected into a device context. The reason is, I want to take several bitmaps, lets say 50 or something, and bitblt them into one big bitmap, and use that as the surface to draw graphics from. It sounds like a good method, but im not sure if it would be, because I dont know how much memory that would use up. Imagine if those 50 bitmaps are each 512 by 512. And they are all BitBlt into a dc created in memory. Would this use up too much memory? or would it be better just to keep 50 seperate dc''s? I am assuming the former. --Fireking Owner/Leader Genetics 3rd Dimension Development
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
Coincoin
Coincoin
Surface memory size = ~(height * width * bitdepth / 8). Some hardware will have strange pitch for optimization and this may result in some memory loss.

Lets say you have a 32 bits 512x512 bitmap it would take 512*512*32/8 = 256Kb * 4 = 1Mb

Now you can put that all in 50 different surfaces or only one big. The former is the better in most cases but be aware that some hardware are limited in surface size.

______________________________
Oooh, you found the horadric cube!

[edited by - Coincoin on September 29, 2002 4:57:12 AM]
Kurioes
Kurioes
fireking means (I think) that he wants to go from Device Context to memory usage, as in int GetMemUsage(HDC hDC);

Try searching the msdn Library; msdn.microsoft.com

Topic Locked

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

Sign in to reply to this topic.