Solved

BITMAPINFOHEADER

Posted on 2002-06-03
2
564 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi, TImage, Png 2 31
Typecasting TBytes to Integer in Delphi XE8 2 38
Can Live bindings change TGrid Cell Colour ? 1 34
Firemonkey Queue list 1 32
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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