Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 2 of 2 total |
Problems loading image from blob |
Fri, Sep 26 2008 3:43 PM | Permanent Link |
Darrell | Hi all ~
saving works like a charm - but loading from DB into a viewing component fails. What am I doing wrong? Thanks for your help Darrell //------------------------------------------------------------------------------ procedure TForm1.ButtonLoadFromDBClick(Sender: TObject); var bs: TDBISAMBlobStream; begin dbit.First; isb.Clear; // clear image viewer try bs := TDBISAMBlobStream.Create( TBlobField( dbit.FieldByName( 'Image' )), bmRead ); isb.Graphic.LoadFromStream( bs ); finally bs.Free; end; end; //------------------------------------------------------------------------------ procedure TForm1.ButtonSaveToDBClick(Sender: TObject); var bs: TDBISAMBlobStream; begin if isb.Graphic.Empty then begin Showmessage( 'No image - no save!' ); Exit; end; try dbit.Edit; try bs := TDBISAMBlobStream.Create( TBlobField( dbit.FieldByName( 'Image' )), bmWrite ); isb.Graphic.SaveToStream( bs ); finally bs.Free; end; dbit.Post; except dbit.Cancel; end; end; //------------------------------------------------------------------------------ |
Fri, Sep 26 2008 6:14 PM | Permanent Link |
Darrell | Oops - never mind; the problem was with my image component. |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |