Page 1 of 1

sending binary image data to a dataGrid

Posted: Sun Mar 17, 2013 12:59 pm
by bobcoffee
I am using binary image data from a database and trying to populate an image object that is located in a datagrid.

I can easily view the binary data in an image object outside a datagrid by setting the text property of the image object as in

Code: Select all

set the text of image "categories" to tImageData
but I can't figure out how to send the data to the image object located in a datagrid (using the form styles not tables)

btw, if the image is locate locally, the following will populate the image object within a datagrid

Code: Select all

put "images/" & "colors.jpg" into theDataA[1]["ImageURL"]
but I am working with the binary image data from a db.

Does anyone know how this is done?

-Coffee

Re: sending binary image data to a dataGrid

Posted: Mon Mar 18, 2013 3:05 pm
by n9yty
bobcoffee wrote:if the image is locate locally, the following will populate the image object within a datagrid

Code: Select all

put "images/" & "colors.jpg" into theDataA[1]["ImageURL"]
but I am working with the binary image data from a db.
That looks like it is pointing the image object to the file where your data is stored.

I don't know if this is the "best" way, but I was doing something similar with pulling data from a website. What I ended up doing was using a temporary hidden image object as a placeholder, and I would bring the image URL in, put it in the placeholder, size it appropriately, use the magic "set the imagedata of image x to the imagedata of image x" to force it to resize/lock and then I grabbed the imagedata to put into theData array for the data grid. This was an attempt to get the smallest memory representation of the image needed for display. It ended up working quite well.

That "magic line" came from here:
http://lessons.runrev.com/s/lessons/m/4 ... nail-image

Hopefully that tutorial will give you some hints as well.