Delphi-Quellcode:
function validtime(s:string):string;
var
i: integer;
begin
for i := 1 to length(s) do
if s[i] <>':'
then result := result +s[i]
else result := result +'_';
end;
Procedure Bild_Speichern;
Var Zeit :TDateTime;
name :String;
img: TPicture;
Jpg: TJPEGImage;
clip: TClipboard;
Begin
Zeit := now;
Clip := Clipboard;
if clip.HasFormat(CF_BITMAP) then
begin
img := TPicture.create;
Jpg := TJPEGImage.create;
name := ('c:\'+'Bild von '+validTime(Timetostr(Zeit))+'.jpg');
img.LoadFromClipboardFormat(CF_Bitmap,clip.GetAsHandle(CF_Bitmap),0);
jpg.Assign(img.bitmap);
jpg.CompressionQuality := 50;
jpg.ProgressiveEncoding := true;
jpg.Compress;
jpg.SaveToFile(name);
clip.clear;
img.Free;
jpg.Free;
end;
End;
des tut. habs grad getestet