Link to home
Start Free TrialLog in
Avatar of Anna Kirova
Anna Kirova

asked on

How to save the image in the .cds File ClientDataSet?

In my .cds file I've ID->ftAutoInc and IMAGE field is ftGraphic.

Where I did mistake? It's not inserting into IMAGE field Plz help me!

procedure TForm1.btnAddImageClick(Sender: TObject);
var Stream:TMemoryStream;
begin
if OpenDialog1.Execute then
begin
Image1.Bitmap.LoadFromFile(OpenDialog1.FileName);

Stream:=TMemoryStream.Create;
Image1.Bitmap.SaveToStream(Stream);

cdsMenu.Insert;
// TBlobField(cdsMenu.FieldByName('IMAGE')).LoadFromStream(Stream);
cdsMenuIMAGE.Assign(Image1.Bitmap);
cdsMenu.Post;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial