06-23-2019 05:38 AM
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?
Solved! Go to Solution.
06-26-2019 09:43 AM
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().