Bitmap memory usage

PhilH

Member
Joined
Aug 22, 2003
Messages
18
I have a question about memory usage.

I draw a bitmap in memory that is tiled from sections of another bitmap stored on the hard disc. The tiled bitmap (tbm) is much larger than the picturebox it is displayed in so that I need to scroll the image.

My current approach is to draw in memory only that section of tbm that can be seen in the picturebox and as the user scrolls the image redraw as necessary. If I make tbm larger than the the picturebox then this will cut down the amount of drawing, eg. I may only have to redraw every 10th scroll event.

My problem is that I dont have any feel for how much memory I can use before I start to affect performance, ie. how large can tbm be? If I have 512 meg RAM and the program is running under Windows 2000 how much spare capacity do I have?
 
hrm... i think roughly speaking, the size of a bitmap can be measured by something like this:

Width * Height * BitsPerPixel /8 = SizeInBytes

to get the in KB, divide the result by 1024. In MB, the KB result again by 1024 and so on. k?

im just counting the image size... no other additional info that might come with the Bitmap class :P
 
So would drawing a 40MB bitmap in memory be considered ridiculously large? Is there any way to find out how much RAM memory a program uses?
 
Back
Top