Ik heb de afbeeldingenmap niet geüpload, maar de img-map bestaat al op mijn pc. Een jpg-afbeelding had in die map moeten staan, maar niets.
https://sourceforge.net/projects/ahk...t.zip/download
Code:
procedure TForm1.LoadJpegFile(const AFileName: string);
var
bmp_filename, JpgFileName, dest_path: String;
begin
BMP_filename := 'F:\bmp.bmp';
JpgFileName := '.\img\bmp.jpg';
dest_path := ExtractFilePath(JpgFileName);
if not DirectoryExists(dest_path)
then
CreateDir(dest_path);
if not fileexists(bmp_filename) then
begin
showmessage('File not found: '+bmp_filename);
exit;
end;
try
Bmp.LoadFromFile(bmp_filename);
Jpg.CompressionQuality := 100;
Jpg.Assign(Bmp);
Jpg.SaveToFile(JpgFileName);
finally
end;
end;
simdesign-master\simlib\nativejpg\sdJpegImage.pas
Code:
// Use the LoadFromFile or LoadFromStream method to load a Jpeg image, and use
// the SaveToFile and SaveToStream method to save a Jpeg image. Use the Bitmap
// property to assign the bitmap to another bitmap, or to work with the actual
// image.
procedure TsdJpegImage.SaveToFile(const AFileName: string);
var
FS: TFileStream;
begin
FS := TFileStream.Create(AFileName, fmCreate);
try
SaveToStream(FS);
finally
FS.Free;
end;
end;
toch is er de TStream-functie in het pakket
Code:
procedure TsdJpegImage.SaveToStream(S: TStream);
Bookmarks