LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem about the canvas.

I want to draw image on the canvas, and my image is the result of image processing using imaq vision, but the result image is jpg file, and the CanvasDrawBitmap( ) function work only to the bmp file, so I have to save the jpg file to the bmp file first,and then read the bmp file to get the ID of the bmp file ,and then use the function CanvasDrawBitmap(),I think this is time consuming, is there any efficient method for the jpg file?
the following is part of my programs:

imaqCast (CanvasImage, image, IMAQ_IMAGE_RGB, NULL, 0);
imaqWriteBMPFile (CanvasImage, "CanvasImage.bmp",TRUE,NULL);
GetBitmapFromFile ("CanvasImage.bmp", &bitmapID2);
CanvasClear (imagePanel, IMAGE_CANVAS,VAL_ENTIRE_OBJECT);
CanvasDrawBitmap (imagePanel, IMAGE_CANVAS, bitmapID2,
MakeRect (0,0,240,320), MakeRect(0,0,240,320));
Dongsheng Zhao
North China Electronic Power Univ.
zds_hd@yahoo.com.cn
0 Kudos
Message 1 of 3
(3,205 Views)
CVI 7.1 can read and write JPG.
For older versions, Guillaume Dargaud has created some nice graphics function panels for CVI.
http://www.gdargaud.net/Hack/LabWindows.html#Jpeg
See some other notes here: http://forums.ni.com/ni/board/message?board.id=180&message.id=12938
0 Kudos
Message 2 of 3
(3,185 Views)
Hi Dongsheng,

I believe the function you may be looking for is called imgPlot and is shipped with the NI-IMAQ driver.

This function will take an image buffer and plot that particular buffer at the given location. More information can be found in the IMAQ function reference, which is installed with the IMAQ driver.

Let me know if you need anything else!

Have a great weekend,

Robert Manion
Applications Engineering
National Instruments
0 Kudos
Message 3 of 3
(3,180 Views)