Solved

BITMAPINFOHEADER

Posted on 2002-06-03
2
546 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
Comment Utility
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
Comment Utility
Thanks a lot!
Very simple and powerfull!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

13 Experts available now in Live!

Get 1:1 Help Now