LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve an image from MySQL database

Hi!!!

i'm really new on LabVIEW.
but i have this problem: i have images storaged into a db of Mysql, the images are into a BLOB field, i wanto to make some sort of select and show the image into a picture control, even in any control.

I know how to make the conection and retrieve the information from the database, but i dont know how to put it into the picture control,
i even tried using the picture control and give to it "Enable Database access" but i dont figure how use it
thanks

Ok, i found in the NI site a solution to do it in access
At this moment i made some changes to the example. but still doesnt want to paint the image. it told me that the variant type is not accord with the type that i want.

i store that image using java, as a array of bytes.....
problem
0 Kudos
Message 1 of 4
(3,642 Views)
Just a few questions...

Do you get a 1D array of data, or 2D? Is this data a jpg, bmp, or simly all
the pixels? What is the formating of the pixels (u8's with lookup table,
grayscale, or RGB, BGR, RGBa, etc)? What is the data format of the array of
bytes you get (U32, U8)? Is the data run length encoded?

What are you using as a data type to convert the variant? It should be an
array of bytes...

How do you want to paint the image? In a picture control, or an IMAQ window?

Images are not as simple as they might seem...

Regards,

Wiebe.


0 Kudos
Message 2 of 4
(3,621 Views)

Wiebe:

I'm using a 1D array of data, because it was the way that i use to store it.

the format of the image is JPG

The data format of the array is U8

I want to paint it in a picture control

0 Kudos
Message 3 of 4
(3,618 Views)

"Xtian79" <x@no.email> wrote in message
news:1223462414909-788825@exchange.ni.com...
> Wiebe:I'm using a 1D array of data, because it was the way that i use to
store it.the format of the image is JPGThe data format of the array is
U8I&nbsp;want to paint it in a picture control

So I assume the 1D array of bytes are all of the pixels. And that the bytes
are stored R1, G1, B1, R2, G2, B2 ... Rn, Gn, Bn.

First thing to do is to get this data from the variant. Use "Variant to
Data" function for this. Wire an array constant of u8's to it. If it does
work, you should see your 1D array data.If this doesn't work, create an
indicator straight from the variant, and let me know what the indicator
says, and forget about the rest for now.

The R,G,B data needs to be converted to U32's. Wire the array to a "Decimate
1D Array". Grow the function, so it has three outputs. The first is an 1D
array of R's. The second are all the G's, the third are the B's. Put the
first to arrays in a "Join Numbers". This will result in a 1D array of
U16's. Use another "Join Numbers" to merge the U16's with the remaining U8
array. This will result in a 1D array of U32's. If, later on, the colors are
reversed, reverse the order of the "Join Numbers" inputs untill they are
correct.

Then, you need to convert the 1D array of U32's to a 2D array of U32's. You
need to know the dimensions of the image for this (wXh). Use "Reshape Array"
function. It's growable, and you'll need two dimensions...

Now you have a 2D array of U32's that will fit right into "Flatten Pixmap".

That should do it.

Regards,

Wiebe.


0 Kudos
Message 4 of 4
(3,612 Views)