Subject Storing Images In JPEG format in BLOB Field.
Author R. S. Patil
Dear Friends,

I want to paste from clipboard a Image in a TImage Component
and store that image
in JPEG format to a blob field. the image quality
requirements are not high so any
other size friendly image formats can also do the job. JPEG
format has been selected
since native TJPEGImage is easily available. If u have some
other alternative
pl. suggest.

I Tried as follows.

if (IB_Query2.State in [dssEdit,dssInsert]) and
((ClipBoard.HasFormat(CF_BITMAP )) or
(ClipBoard.HasFormat(CF_PICTURE)) ) then
begin
imgOpPhoto.PasteFromClipboard; // imgOpPhoto is a
TImge
jpg.Assign(imgOpPhoto.Picture.Graphic); // jpg is a
TJpegImage
jpg.CompressionQuality := 50;
jpg.Grayscale := true;
jpg.Smoothing := true;
imgOpPhoto.Picture.Assign(jpg);
IB_Query2.FieldByName('PHOTO').Assign(jpg);
end;