uses Jpeg;
function BMPtoJPG(var BMPpic, JPGpic: string): boolean;
var
Bitmap: TBitmap;
JpegImg: TJpegImage;
begin
result := False;
Bitmap := TBitmap.Create;
try
Bitmap.LoadFromFile(BMPpic);
JpegImg := TJpegImage.Create;
try
JpegImg.Assign(Bitmap);
JpegImg.SaveToFile(JPGpic);
result := True;
finally
JpegImg.Free
end;
finally
Bitmap.Free
end;
end;