Solved

Loading bitmap portions

Posted on 1998-09-01
4
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

688 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