LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I include Win32 API function, BitBlt(), in CVI7.0

Would someone please help,
I have two canvases on a PANEL: They are SOURCECANVAS and DESTCANVAS. I would like to copy a picture from SOURCECANVAS to DESTCANVAS
using Win32 API function  BitBlt()  in my CVI 7.0 code. (NOTE: I need to use this Win32 API function). From MSDN, BitBlt() function has the following form:
Bool BitBlt (HDC hdcDest,
                  int    nXDest,
                  int    nYDest,
                  int    nWidth,
                  int    nHeight,
                  HDC Src,
                  int    nXSrc,
                  int    nYSrc,
                  DWORD dwRop);
My question is  "how do I use CVI to obtain the destination Device Context handle (hdcDest), and also the source Device Context handle (Src)?"
A sample code would be appreciated.
Thanks in advance.
Bob
0 Kudos
Message 1 of 3
(3,118 Views)

Hello Robert,

My suggestion would be to use the following example which step through how to use that function in a .NET language, then use the Win32 to .NET function map to see which function in the Win32 SDK needs to be called to simulate the same results.  For instance to get the first parameter of the BitBlt function, you could use the GetWindowDC() function. 

Hope that helps.
0 Kudos
Message 2 of 3
(3,100 Views)

If you want to copy a picture, use GetCtrlBitmap() to grab the bitmap from the source canvas and then use CanvasDrawBitmap() to draw that bitmap to the destination canvas.

Hope  this helps

Bilal Durrani
NI
0 Kudos
Message 3 of 3
(3,085 Views)