The example of this article describes the method of converting BMP format graphics into JPG format graphics in Delphi. Share it with everyone for your reference. The specific implementation method is as follows:
Copy the code code as follows:
procedure ConvertBMPtoJPG(SFileName,DFileName:string);
Var
J:TJpegImage;
I:TBitmap;
S,D:String;
begin
s:=SFileName;
d:=DFileName;
J:=TJpegImage.Create;
I:=TBitmap.Create;
I.LoadFromFile(s);
J.Assign(I);
I.Free;
d:=changefileext(d,'.jpg');
J.SaveToFile(d);
Application.processmessages;
J.Free;
end;
I hope this article will be helpful to everyone's Delphi programming.