LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer IMAQ Image to bitmap?

I want to use the IMAQ Vision function "imaqReadFile" and the User Interface Library Bitmap in the same program. At the moment I use the clipboard to transfer an IMAQ Image to a bitmap that I want to display in a canvas. This seems to me to be not the best solution. Does anybody know a better way to do this?

Thanks in advance!
Thomas
0 Kudos
Message 1 of 6
(4,138 Views)
SRQ: 197088

Hello Thomas,

can you specify your question?
are the imaqReadFile and the User Interface Library Bitmap independent in use or do they get involved with each other?
And where exactly do you use the clipboard to transfer the image?

regards,

Robert H.
National Instruments
0 Kudos
Message 2 of 6
(4,138 Views)
Sorry i put the wrong SRQ, the right is: 196300
0 Kudos
Message 3 of 6
(4,138 Views)
It should work similar to this:
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000F4850000&ECategory=Vision

You just need to do it the other way.

Richard H.
National Instruments
0 Kudos
Message 4 of 6
(4,138 Views)
Hi Robert,
here a describtion of what my program shall do:
The program loads an image file using the imaqReadFile function. This image shall be displayed in a canvas using the CanvasDrawBitmap function.
At the moment my program first copies the image into the clipboard (imaqImageToClipboard), then copies the clipboard contents into a bitmap (ClipboardGetBitmap). Finally with CanvasDrawBitmap the bitmap is displayed in the canvas.
In this way I can use the image processing functions of IMAQ vision library in conjuction with having a dialog based gui (I don't want to use the imaqDisplayImage function). But it seems to me as if using the clipboard is not the best way. I have to admit that, being quite new to LabWindows/CVI, I am not very familiar at the momen
t with the imaqImageToArray function which I believe might be the better choice.

Thanks in advance
Thomas

P.S.: Here comes what my program in principle does:
imaqReadImage(...)
imaqImageToClipboard(...)
ClipboardGetBitmap(...)
CanvasDrawBitmap(...)
0 Kudos
Message 5 of 6
(4,137 Views)
Hello Thomas,

i tried several possibilities and from a IMAQ example i tried the following:
imaqReadFile(...)
NewBitmap(...)
CanvasDrawBitmap(...)

in the function NewBitmap i passed the imaq image created from the readfile function as the parameter "Bits" casted how follows: (char*) imageToDisplay

Hope this helps you further,
regards,

Robert H.
National Instruments
0 Kudos
Message 6 of 6
(4,137 Views)