Subject | [IBO] Re: READING AND WRITING BLOBS |
---|---|
Author | colincoleman2002 |
Post date | 2008-11-21T15:23:55Z |
Thanks to the both of you, it now works, i used both your suggestions
and coded as BLOB type 0, then did the following code
procedure TFormAssets.BitBtn3Click(Sender: TObject);
Var ojpg : TJpegImage;
oStream :TMemoryStream;
begin
{ load the image }
if NOT IBOQueryIMG.Active then
IBOQueryIMG.Open;
oJpg := TJpegImage.Create;
oStream := TMemoryStream.Create;
if IBOQueryIMG.FieldByName('ZIMAGE').isnull then
Showmessage('No Image Available');
Try
TBlobField
(IBOQueryIMG.FieldByName'ZIMAGE')).SaveToStream(oStream);
oStream.Position := 0;
oJpg.LoadFromStream(oStream);
ImageAsset.Picture.Graphic := oJpg;
ImageAsset.Proportional := True;
Finally
oJpg.Free;
oStream.Free;
End;
end;
Thanks very much
Colin
and coded as BLOB type 0, then did the following code
procedure TFormAssets.BitBtn3Click(Sender: TObject);
Var ojpg : TJpegImage;
oStream :TMemoryStream;
begin
{ load the image }
if NOT IBOQueryIMG.Active then
IBOQueryIMG.Open;
oJpg := TJpegImage.Create;
oStream := TMemoryStream.Create;
if IBOQueryIMG.FieldByName('ZIMAGE').isnull then
Showmessage('No Image Available');
Try
TBlobField
(IBOQueryIMG.FieldByName'ZIMAGE')).SaveToStream(oStream);
oStream.Position := 0;
oJpg.LoadFromStream(oStream);
ImageAsset.Picture.Graphic := oJpg;
ImageAsset.Proportional := True;
Finally
oJpg.Free;
oStream.Free;
End;
end;
Thanks very much
Colin