uses graphics, jpeg;
procedure ConvertBMPtoJPG(filename:string);
Var
J:TJpegImage;
I:TBitmap;
S:String;
begin
s:=filename;
J:=TJpegImage.Create;
I:=TBitmap.Create;
I.LoadFromFile(s);
J.Assign(I);
I.Free;
s:=changefileext(s, '.jpg');
J.SaveToFile(s);
Application.processmessages;
J.Free;
end;
procedure ConvertJPGtoBMP(filename:string);
Var
J:TJpegImage;
I:TBitmap;
s:string;
begin
s:=filename;
I:=TBitmap.Create;
J:=TJpegImage.Create;
J.LoadFromFile(s);
I.Assign(J);
J.Free;
s:=changefileext(s, '.bmp');
I.SaveToFile(s);
I.Free;
Application.processmessages;
end;