LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use the resource file(.res) in labwindows

Solved!
Go to solution

i have cretate an pic.res file with RC.exe.  In pic.res file ,only an jpg file,see below.

JPG_1  RCDATA   "mei.jpg"

Then ,i added the pic.res to CVI project。

I want to use CanvasDrawBitmap()  to load the picture in pic.res on Canvas control.

But i don't konw how to get the bitmapID of "mei.jpg" in the pic.res file.

can someone give any advice?

0 Kudos
Message 1 of 2
(2,302 Views)
Solution
Accepted by topic author winter1970

You will need to use Windows API functions such as LoadBitmap() or LoadImage() and then extract the bitmap information with GetDIBits() from the handle to convert it into an image by passing the extracted data to the NewBitmapEx() CVI function.

 

Much simpler would be to simply store the image in (a subdirectory of) your executable directory and use the CVI function GetBitmapFromFile().

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(2,254 Views)