Home » U++ Library support » U++ SQL » Image in QLITE3 database (Load an ImgCtrl image from an SQLITE3 database)
Image in QLITE3 database [message #50237] |
Sat, 01 September 2018 17:32 |
raanan
Messages: 1 Registered: September 2018
|
Junior Member |
|
|
I can read a BLOB field that I know contains an image of some kind (probably JPEG or PNG) from an SQLITE3 database into a String, but that is afar as I can get. I did not create or populate this database (it is used by an application that I use, which works and shows these images). In fact, the images are pictures that I took with my phone, and added to the database with the application. But how do I set this String value into an ImgCtrl to show in window?
I have tried as follows.
String photo; // set with SQL select statement
And then this, which did not work.
Image img(photo);
ImgCtrl ctrl;
ctrl.SetImage(img); // crashes with no message
I tried LOG(photo), which showed a lot of binary values, including the text JFIF, so I did as follows.
FileOut out;
out.Open("test_photo.jfif");
out.Put(recipe.photo);
out.Close();
Sure enough, it created exactly the photo file that I expected, a JFIF file that I was able to open and view. Unfortunately, there are no examples on the web site showing how to load an ImgCtrl from such a String. An example would of course be appreciated.
[Updated on: Sun, 02 September 2018 01:23] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri Mar 29 02:27:52 CET 2024
Total time taken to generate the page: 0.00892 seconds
|