implementation
uses JPEG;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
jpg: TJPEGImage;
BMP: TBitmap;
begin
bmp:= TBitmap.Create;
jpg:= TJPEGImage.Create;
try
bmp.LoadFromFile('c:/test.bmp');
jpg.Assign(bmp);
jpg.CompressionQuality:= 50; //1..100
jpg.Compress;
//jpg.SaveToFile('c:/out.jpg');
DBImage1.DataField:= 'IMage';
DBImage1.Picture.Bitmap.Assign(jpg); //may be raise error
Table1.Edit;
Table1.Post; //save to db
finally
bmp.Free;
jpg.Free;
end;
end;