Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 don't 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?

Posted

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?

 

i'm just counting the image size... no other additional info that might come with the Bitmap class :P

Menge
Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...