LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I get a picture control pointer?

Hi!
I'm trying to compress an image (picture) to jpeg with the Intel Jpeg Library. I need to convert to jpeg using a buffer (not a file). I know how to do that using intel dll, but the function has a parameter which is an structure and one of the elements is the pointer to the uncompress data (the image or picture), so I need to get the pointer of the control, I think,maybe I'm wrong!

Any help will be appreciated!
0 Kudos
Message 1 of 2
(2,590 Views)
> I'm trying to compress an image (picture) to jpeg with the Intel Jpeg
> Library. I need to convert to jpeg using a buffer (not a file). I know
> how to do that using intel dll, but the function has a parameter which
> is an structure and one of the elements is the pointer to the
> uncompress data (the image or picture), so I need to get the pointer
> of the control, I think,maybe I'm wrong!
>


This is possible, but a little more difficult than the file based VI
built into the picture control palette.

What you want to do is have a 2D array of pixels. I suspect that the
Intel Library wants them to be RGB formatted in three or four byte
records. A 1D array such as is returned by the picture loading VIs will
work just as well. Pass the array into a DLL
using the Call Library
Function, and set the array to be passed by pointer.

If your Intel compression function takes the pointer as a single
parameter, then you would likely be finished, but if it is in a struct,
then you will either need to arrange the params on the stack in the same
order they would be in the struct. Note that this makes a few
assumptions about how the compiler is passing structs by value and will
not work for all compilers/platforms. The safer and more assured way of
doing this requires that you pass the pieces into a helper DLL function
that repacks the pointer and other items into a struct and then calls
the compress function.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,590 Views)