Solved

BITMAPINFOHEADER

Posted on 2002-06-03
2
568 Views
Last Modified: 2008-02-01
Hello,
How can I get the BITMAPINFOHEADER of the TBitmap?
0
Comment
Question by:libbysharf
[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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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 this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

696 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