Showing results for 
Search instead for 
Did you mean: 

Image capture function returning an unsigned char *

Being fairly new to LabVIEW, I'm looking for advise/help on a way to
view an image I capture using a capture card that does not have
LabVIEW/IMAQ drivers.

Win2000, PentiumIII, 256mb
LabVIEW 6.0
Kodak MegaPlus 4.2i 8-bit single color camera
E.D.T. PCI DVK capture card

I have been able to use the DLLs that are supplied with the capture
card to access the width, height, but when I capture an image the C
function returns an unsigned char pointer to the address of the image
buffer (raw data). The image size ~2kbytes x ~2kbytes.

The only solution I have come up with is after each image capture to
go into a loop incrementing the pointer and storing the value it
points to into a 2D array. This arra
y I then place into an LV
intensity graph. A drawback to this solution is that I have to grab
the 8-bit value that each pointer points to and I have not found a
LabVIEW command that lets you get a value from a pointer. Also taking
4 megabytes and storing them in a different place seems very

Has anyone else run into the problem ? What solutions are out there?
Will I be able to create code and view the image easier with the
purchase of the NI Vision add-on?
0 Kudos
Message 1 of 3
Actually, I think you can use the unsigned char string the pointer is pointing directly. If you are able to read that string in LabVIEW, then use the function "String to Bite Array" located in:

Diagram palette -> String -> String/Array/Path Conversion

to convert it into LabVIEW format. Then, with the rest of the information (width and height), the only thing you need is the color information and you will be able to display the image using the function "Draw Flattened Pixmap". Check if you can read the color table information using the dll too. If not, I can suggest to open any other 8-bit bitmap in LabVIEW (preferibly a greyscale image), copy the color table as a constant and use it to try to display your image.

If you are unable to read the unsigned char string
, you may need to create a wrapper dll for the dll of your card. If this is the case, try passing the string to LabVIEW as a LStrHandle. Refer to the document "Using External Code in LabVIEW" to learn how to do that. This document is included with LabVIEW, or you can download it at:

Using External Code in LabVIEW

Best regards;
Enrique Vargas
Message 2 of 3


I also facing same problem i need to get the image from the dll the dll returning structure has the unsigned char * how to get this ?

pls reply me i am using labview 8.2 i attached what i tried but when i truy run this lv is crashing .

0 Kudos
Message 3 of 3