LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

handle to Device Context

Hi,

i'm programming an application in LabView 6.1 using an ActiveX control (an image). I want to take the image (ActiveX control) and convert to a picture in Labview. A method of this ActiveX is "DrawToDc" and the syntax in C is "object.DrawToDC(hDC As OLE_HANDLE)". "hDc" is the Handle to the device context of the window to draw in. So, does anybody know how to get this handle to a picture control in the front panel? If anyone has another way to convert the activeX image to a picture, any suggestion will be grateful!

Thanks
0 Kudos
Message 1 of 3
(3,167 Views)
SBC,

You will not be able to get a handle to a particular control. I would suggest any method that either writes the picture to a file that LabVIEW can read back in or converts the image data to an array that can be passed.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(3,167 Views)
> i'm programming an application in LabView 6.1 using an ActiveX
> control (an image). I want to take the image (ActiveX control) and
> convert to a picture in Labview. A method of this ActiveX is
> "DrawToDc" and the syntax in C is "object.DrawToDC(hDC As
> OLE_HANDLE)". "hDc" is the Handle to the device context of the window
> to draw in. So, does anybody know how to get this handle to a picture
> control in the front panel? If anyone has another way to convert the
> activeX image to a picture, any suggestion will be grateful!
>


The thing you are trying to use is very platform specific, and the Image
Control will not directly work with it. If you are able to use some
other GDI functions, you can get them connected. The key will be to
create a memory
bitmap and a memory HDC for it. You can pass the HDC to
the ActiveX control, then afterwards, you can read the contents of the
bitmap back as a 2D array, and if it has a color table, you can read
that out too. You can then pass this info to the Image Control.

Greg McKaskle
0 Kudos
Message 3 of 3
(3,167 Views)