jamesr123456
asked on
INTERBASE IBDATASET IMAGE BLOB
Hi,
I'd like to know how to store a jpg/bmp as a blob in interbase using the ibdataset component.
thx
I'd like to know how to store a jpg/bmp as a blob in interbase using the ibdataset component.
thx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
dbImage dosnt support jpg from what I can see... a further example for any1 looking:
var
S: TStream;
I: TJpegImage;
// to write image
begin
image1.Picture.LoadFromFil e(fileimag e.FileName );
I := TJpegImage.Create;
I.Assign(Image1.Picture.Gr aphic);
S := ibDataSet1.CreateBlobStrea m(ibDataSe t1.FieldBy Name('prod uct_pictur e'), bmWrite);
I.SaveToStream(S);
S.Free;
I.Free;
end;
// to read image
begin
I := TJpegImage.Create;
S := ibDataSet1.CreateBlobStrea m(ibDataSe t1.FieldBy Name('prod uct_pictur e'), bmRead);
I.LoadFromStream(S);
Image1.Picture.Assign(I);
I.Free;
S.Free;
end;
var
S: TStream;
I: TJpegImage;
// to write image
begin
image1.Picture.LoadFromFil
I := TJpegImage.Create;
I.Assign(Image1.Picture.Gr
S := ibDataSet1.CreateBlobStrea
I.SaveToStream(S);
S.Free;
I.Free;
end;
// to read image
begin
I := TJpegImage.Create;
S := ibDataSet1.CreateBlobStrea
I.LoadFromStream(S);
Image1.Picture.Assign(I);
I.Free;
S.Free;
end;
ASKER