LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with imaqImageToArray() call

Hello,

I'm new to the LabWindows development environment, so I thought I'd ask for help here.

I inherited some code from a previous lab. The code is suppose to snap from a CCD camera and display it on a canvas. However, once run, the program displays some funky horizontal lines onto the screen.

By adding the imaqDisplayImage call, I can see that the CCD image is fine, which make me think it is the imaqImageToArray call which has some kind of problem with it.

I'm wondering if anyone has ever seen something like that, where instead of the captured image, you get a bunch of lines.

<--snip-->
imaqDisplayImage (liveImage, 0, 1); //works fine

liveChar = (unsigned char*)imaqImageToArray (liveImage, IMAQ_NO_RECT, NULL, NULL);
NewBitmap (IMAGE_X, 8, IMAGE_X, IMAGE_Y, paletteGrey, liveChar, 0, &liveBit);
CanvasDrawBitmap (panelCollect, PANEL_COLL_CANVAS_LIVE, liveBit, VAL_ENTIRE_OBJECT, MakeRect(0,0,480,640));
<--snip-->

I've attached the output image.

thanks
Lorne
0 Kudos
Message 1 of 2
(3,154 Views)
Hi Lorne,

I believe we spoke about the problem this morning and it was an incorrect camera file selection causing it. Please let me know if you have any other questions or if this hasn't been resolved yet.

Regards,
Nipun M
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,131 Views)