var
ms:tmemorystream;
jp:TJpegImage;
begin
ms:=tmemorystream.Create;
jp:=TJpegImage.Create;
try
with ADOQuery1 do
begin
Open;
First;
MoveBy(StrToInt(Edit1.Text));
TBlobField(FieldByName('i')).SaveToStream(ms);
Close;
end;
ms.Position:=0;
jp.LoadFromStream(ms);
Image1.Picture.Bitmap.Assign(jp);
finally
ms.Free;
jp.Free;
end;
end;
For BMP, directly display it in some TImage component. For others like JPEG and GIF, you should use JPEG unit or TGIFImage component. JPEG support is enclosed in Delphi while TGIFImage component is a popular component you can dowload from web, and it is aldo free.