Delphi-Quellcode:
function GetPictureFormat(Pic: TPicture): String;
begin
Result := Pic.Graphic.ClassName;
end;
Das ist schonmal was
Wenn du den Dateinamen hast dann kannst du auch einfach
ExtractFileExt(Dateiname)
benutzen !
Ansonsten kannst du die Funktion oben abändern:
Delphi-Quellcode:
function GetPictureFormat(Pic: TPicture): String;
begin
if Pic.Graphic.Classname = 'TBitmap' then Result := '.bmp'
else
if Pic.Graphic.Classname = 'TJPEGImage' then Result := '.jpeg'
else Result := 'Unknown format!';
end;
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."