Solved

BITMAPINFOHEADER

Posted on 2002-06-03
2
559 Views
Last Modified: 2008-02-01
Hello,
How can I get the BITMAPINFOHEADER of the TBitmap?
0
Comment
Question by:libbysharf
2 Comments
 
LVL 2

Accepted Solution

by:
freshman3k earned 50 total points
ID: 7052090
Hello!

The following should work:

Var
Bitmap: TBitmap;
BitmapHeader: pBitmapInfo;
BitmapImage : POINTER;
HeaderSize : DWORD;
ImageSize : DWORD;
Begin
  Bitmap:=TBitMap.Create;
  Bitmap.LoadFromFile('c:\picture.bmp');
 
  GetDIBSizes(Bitmap.Handle, HeaderSize, ImageSize);
  GetMem(BitmapHeader, HeaderSize);
  GetMem(BitmapImage, ImageSize);
 
  GetDIB(Bitmap.Handle,Bitmap.Palette,BitmapHeader^,BitmapImage^);
 {the variable 'BitmapHeader' now contains the header of the bitmap}

  FreeMem(BitmapHeader);
  FreeMem(BitmapImage);
End;

pBitmapInfo is the same as BITMAPINFOHEADER


Hope this helps!
0
 

Author Comment

by:libbysharf
ID: 7053268
Thanks a lot!
Very simple and powerfull!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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