Never mind, I've found a way how to do that.
TMemoryStream *str = new TMemoryStream;
str->WriteBuffer(row[0], mysql_fetch_lengths(res)[0]);
str->Position = 0;
TJPEGImage *img = new TJPEGImage;
img->LoadFromStream(str);
Image1->Picture->Assign(img);
img->Free();
str->Free();
Hiya,
I have a valid mysql connection to a MySQL database. What I want is to display a picture from the DB in TImage control. The pictures are stored as BLOB and LONGBLOB data types. This is how I get the image:
mysql_query(conn, "SELECT picture FROM customers WHERE name='John Smith'");
res...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.