Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to output a binary bitmap from a dll?

Hi!

I have made a type of a picture generator - a dll written in C++/MFC.
Now I need to make it compatible with LabView 6. The problem is that I
don't know what my exported function should return, nor what the
parameters should be. I have seen similar functions in IMAQ, which
somehow return an image in a void *image. Well, basically all I need
to know is what the function should look like and what it should
return.

int GetPicture(void *image , ..., ..., ??)
{
Fill void *image with what?
How should I allocate memory for the image pointer?
}

I want to be able to transfer a picture from this function and output
it in a LabView program.

Please, help me! 😃

/Chris, Sweden
0 Kudos
Message 1 of 3
(3,174 Views)
LabVIEW provides a VI for just this purpose. It's called IMAQ ArrayToImage.vi and it is designed to take in a 2D array of pixels (U8 or I16) and convert it into the *image datatype.

This way you can write your function to return a 2D array of U8s and just pass it into LabVIEW.

KyleV
0 Kudos
Message 2 of 3
(3,174 Views)
How will LabView know the size of the 2d array? That's the whole
problem.
What should the C-function look like? Where should the memory be
declared? In my dll or LabView?


Kyle V wrote in message news:<506500000005000000AB2B0100-1042324653000@exchange.ni.com>...
> LabVIEW provides a VI for just this purpose. It's called IMAQ
> ArrayToImage.vi and it is designed to take in a 2D array of pixels (U8
> or I16) and convert it into the *image datatype.
>
> This way you can write your function to return a 2D array of U8s and
> just pass it into LabVIEW.
>
> KyleV
0 Kudos
Message 3 of 3
(3,174 Views)