![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Wed, Dec 19 2012 2:07 PM | Permanent Link |
Vitor Martins Pregitzer & Ca., Lda | The following code:
Stream :TStream; Stream := TStream.Create; try DmSyn.EDBTable_SynListImage.SaveToStream(Stream); Image1.Picture.Bitmap.LoadFromStream(Stream); finally Stream.Free; end; Generate exception "Abstract error" when call SaveToStream? I need load a image from a BLOB field and show using an TImage. Thanks Vitor Martins. |
Wed, Dec 19 2012 3:11 PM | Permanent Link |
Raul ![]() | You should not really use TStream but one of its descendant -
TMemoryStream (if dealing in ram) or TFileStream (for file system) Raul On 12/19/2012 2:07 PM, Vitor Martins wrote: > The following code: > > Stream :TStream; > > Stream := TStream.Create; > try > DmSyn.EDBTable_SynListImage.SaveToStream(Stream); > Image1.Picture.Bitmap.LoadFromStream(Stream); > finally > Stream.Free; > end; > > Generate exception "Abstract error" when call SaveToStream? > I need load a image from a BLOB field and show using an TImage. > > Thanks > Vitor Martins. > |
Wed, Dec 19 2012 3:25 PM | Permanent Link |
Vitor Martins Pregitzer & Ca., Lda | Tanks Raul
Change from TStream to TMemoryStream, no error but the image is not show on TImage. MemStream := TMemoryStream.Create; DmSyn.EDBTable_SynListImage.SaveToStream(MemStream); try Image1.Picture.Bitmap.LoadFromStream(MemStream); finally MemStream.Free; end; end; Thanks Vitor Martins Raul wrote: You should not really use TStream but one of its descendant - TMemoryStream (if dealing in ram) or TFileStream (for file system) Raul On 12/19/2012 2:07 PM, Vitor Martins wrote: > The following code: > > Stream :TStream; > > Stream := TStream.Create; > try > DmSyn.EDBTable_SynListImage.SaveToStream(Stream); > Image1.Picture.Bitmap.LoadFromStream(Stream); > finally > Stream.Free; > end; > > Generate exception "Abstract error" when call SaveToStream? > I need load a image from a BLOB field and show using an TImage. > > Thanks > Vitor Martins. > |
Wed, Dec 19 2012 3:40 PM | Permanent Link |
Raul ![]() | Vitor,
Completely untested but i would suggest making couple fo small modification and see what happens: MemStream := TMemoryStream.Create; try TBlobField(DmSyn.EDBTable_SynListImage).SaveToStream(MemStream); MemStream.Position := 0 Image1.Picture.Bitmap.LoadFromStream(MemStream); finally MemStream.Free; end; Raul On 12/19/2012 3:25 PM, Vitor Martins wrote: > Tanks Raul > > Change from TStream to TMemoryStream, no error but the image is not show on TImage. > > MemStream := TMemoryStream.Create; > DmSyn.EDBTable_SynListImage.SaveToStream(MemStream); > try > Image1.Picture.Bitmap.LoadFromStream(MemStream); > finally > MemStream.Free; > end; > end; > > Thanks > Vitor Martins |
Thu, Dec 20 2012 5:00 AM | Permanent Link |
Vitor Martins Pregitzer & Ca., Lda | Thanks Raul All works fine, it's necessary put the memorystream at position 0 before load the stream. Best regards, Merry Christmas Vitor Martins Raul wrote: Vitor, Completely untested but i would suggest making couple fo small modification and see what happens: MemStream := TMemoryStream.Create; try TBlobField(DmSyn.EDBTable_SynListImage).SaveToStream(MemStream); MemStream.Position := 0 Image1.Picture.Bitmap.LoadFromStream(MemStream); finally MemStream.Free; end; Raul On 12/19/2012 3:25 PM, Vitor Martins wrote: > Tanks Raul > > Change from TStream to TMemoryStream, no error but the image is not show on TImage. > > MemStream := TMemoryStream.Create; > DmSyn.EDBTable_SynListImage.SaveToStream(MemStream); > try > Image1.Picture.Bitmap.LoadFromStream(MemStream); > finally > MemStream.Free; > end; > end; > > Thanks > Vitor Martins |
This web page was last updated on Monday, July 7, 2025 at 06:35 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |