[Gambas-user] Display binary data from MySQL DB

Rob Kudla sourceforge-raindog2 at ...94...
Fri Jun 2 16:40:05 CEST 2006


On Fri June 2 2006 04:28, gambas at ...1443... wrote:
> I was wodering if there is a way to view binary data from a
> mysql database in a drawing area?
> In php there is functionality to extrat the data and display
> it as an image.

Well, if you've done a select and have a row in a Result object, 
you could always do something like

File.Save("somefilename.png", myResultObject["myBinaryField"])
' change .png to whatever format is appropriate for 
' your binary field, assuming it's one Qt/Gambas can display
myPictureObject = Picture.Load("somefilename.png")
Draw.Begin(myDrawingArea)
Draw.Picture(myPictureObject)
Draw.End

I can't think of a reason why that wouldn't work....  

Rob




More information about the User mailing list