this slowpoke moves

Bitmap Header Information

procedure TForm1.Button1Click(Sender: TObject);
var
  FileHeader: TBitmapFileHeader;
  InfoHeader: TBitmapInfoHeader;
  Stream    : TFileStream;
begin
  Stream := TFileStream.Create('ascii.bmp', fmOpenRead or fmShareDenyNone);
  try
    Stream.Read(FileHeader, SizeOf(FileHeader));
    Stream.Read(InfoHeader, SizeOf(InfoHeader));

    Listbox1.Items.Add(Format('Größe des Bitmaps: %d Bytes', [FileHeader.bfSize]));
    Listbox1.Items.Add(Format('Breite des Bitmaps: %d Pixel', [InfoHeader.biWidth]));
    Listbox1.Items.Add(Format('Höhe des Bitmaps: %d Pixel', [InfoHeader.biHeight]));
    Listbox1.Items.Add(Format('Farbtiefe: %d bit', [InfoHeader.biBitCount]));
    Listbox1.Items.Add(Format('Size: %d bit', [InfoHeader.biSize]));
    Listbox1.Items.Add(Format('Planes: %d bit', [InfoHeader.biPlanes]));
    Listbox1.Items.Add(Format('Compression %d bit', [InfoHeader.biCompression]));
    Listbox1.Items.Add(Format('SizeImage %d bit', [InfoHeader.biSizeImage]));
    Listbox1.Items.Add(Format('XPelsPerMeter %d bit', [InfoHeader.biXPelsPerMeter]));
    Listbox1.Items.Add(Format('YPelsPerMeter %d bit', [InfoHeader.biYPelsPerMeter]));
    Listbox1.Items.Add(Format('ClrUsed %d bit', [InfoHeader.biClrUsed]));
    Listbox1.Items.Add(Format('ClrImportant %d bit', [InfoHeader.biClrImportant]));
  finally
    Stream.Free;
  end;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate