Solved

Loading bitmap portions

Posted on 1998-09-01
4
200 Views
Last Modified: 2010-04-30
Lets say you have a really large bitmap file, one too large to completely load into the computer's memory.  Can you load and display only a selected area of the bitmap without loading the rest of the bitmap into the computer's memory?
0
Comment
Question by:totalitary
  • 2
4 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1432465
First, no bitmap is too large to fit in computer's memory. Even if it's 1600x1200x24 colors, it won't take more then 6MB. IF you just want to display part of it, you can load it to a hidden picture box, and then use PaintPicture to transfer part of it to another box or form. If you still want to read only part of it, you will have to do that manualy, there's no built in way for it
0
 

Author Comment

by:totalitary
ID: 1432466
The image is 6ft by 4ft so its not possible to load it into memory without waiting 30 minutes.
0
 
LVL 2

Accepted Solution

by:
polygon earned 200 total points
ID: 1432467
You'll need to learn the BMP file structure. It is smth like:

BITMAPHEADER a
BITMAPINFOHEADER b
PALLETE c
THEBITMAP d

then you read just this part that you need.
Say, you get the headers to see how you bitmap is compressed and some other info to help you read the actual info you need. Then say read just bytes starting at position 1234 to 1334, 4567 to 5667, ... to get just a given rectangle of your bitmap.
0
 

Author Comment

by:totalitary
ID: 1432468
Does anyone know the BMP header stucture and how would you tranfer the information from the chosen bytes to the screen?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now