Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 3 of 3 total |
Loading PNG image file saved in BLOB to TPicture |
Mon, Nov 14 2011 10:37 PM | Permanent Link |
IQA | Hi Tim,
This might be an easily answered question, but I'm getting stumped as to the best way to acheive this. I have PNG files saved in BLOB fields and want to load a particular blob into a component that uses TPicture to display the image. I'm using C++ Builder. If anyone has a good approach please let me know, Thanks, Phil. |
Mon, Nov 14 2011 11:00 PM | Permanent Link |
IQA | It's OK... I worked out how to do it after some more testing.... If it's useful to anyone else here's the code (imagedata in the QUERY is a BLOB field storing PNG images):
TEDBBlobStream *BlobStream; TPngImage *mypng = new TPngImage; TEDBQuery * GetImageQuery = new TEDBQuery(NULL); GetImageQuery->DatabaseName = "EDB"; GetImageQuery->SessionName = "EDSSession"; GetImageQuery->SQL->Clear(); GetImageQuery->SQL->Add("SELECT imagedata FROM styleimages WHERE imageID = 1"); GetImageQuery->ExecSQL(); BlobStream = new TEDBBlobStream((TBlobField *)GetImageQuery->FieldByName("imagedata"),bmRead); mypng->LoadFromStream(BlobStream); MyBlock->Picture->Assign(mypng); delete BlobStream, mypng, GetImageQuery; |
Tue, Nov 15 2011 2:16 PM | Permanent Link |
Fernando Dias Team Elevate | Philip,
Thanks for sharing. -- Fernando Dias [Team Elevate] |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |