PhilH Posted October 7, 2003 Posted October 7, 2003 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? Quote
Menge Posted October 8, 2003 Posted October 8, 2003 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 Quote Menge
PhilH Posted October 8, 2003 Author Posted October 8, 2003 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.