uses clipbrd;
function ClipBmpInf(out wdth, hght: integer): boolean;
var
bih: PBitmapInfoHeader;
begin
if Clipboard.HasFormat(CF_DIB) then begin
bih := PBitmapInfoHeader(Clipboard.GetAsHandle(CF_DIB));
if (bih <> nil) then begin
wdth := bih^.biWidth;
hght := bih^.biHeight;
Result := true;
exit;
end;
end;
Result := false;
end;
// Beispielaufruf
procedure TForm1.Button4Click(Sender: TObject);
var w, h: integer;
begin
clipboard.assign(Image1.picture.graphic); // nur zum Testen
if ClipBmpInf(w, h) then
ShowMessageFmt('%d x %d Pixel', [w, h]) else
Showmessage('Kein Bild in der Zwischenablage gefunden');
end;