Solved

Loading bitmap portions

Posted on 1998-09-01
4
193 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now