You can easily get information about bitmap files such the file size, image
height & width, bit count and colors used.
The TBitmapFileHeader (tagBITMAPFILEHEADER - Windows
API) record is declared in Windows.pas although it is not
mentioned in Delphi help. The same situation is with the
TBitmapInfoHeader (tagBITMAPINFOHEADER - Windows API)
record.
Byte location in the file which is first byte of image
var
BitmapFileHeader: TBitmapFileHeader;
BitmapInfoHeader: TBitmapInfoHeader;
FileStream : TFileStream;
Begin
...
// The file stream to the file. You should change the file path :-)
FileStream := TFileStream.Create('C:WindowsBubbles.bmp', fmOpenRead);
try
FileStream.Read(BitmapFileHeader, SizeOf(BitmapFileHeader));
FileStream.Read(BitmapInfoHeader, SizeOf(BitmapInfoHeader));
finally
FileStream.Free;
end;
...
end;