LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possinble to get the DC of a CANVAS?

Hi,
I would like to use SDK functions to directly draw on a CANVAS control. Is
it possible to get the handle of the CANVAS device context (DC) for that
purpose?
Especially I would like to draw bitmaps, since CVI has problems displaying
shrinked bitmaps on a CANVAS.

I already tried to generate my own child window (of a CVI top level panel)
for drawing using CreateWindow() but this causes a GPF sometimes later in
RunUserInterface(). I guess CVI doesn't know how to handle this new child
window.
0 Kudos
Message 1 of 2
(2,885 Views)
No, the CVI canvas doesn't build on the DC Windows architecture since it's been around before that existed. It is implemented natively and so there is no underlying DC that you could use. I would recommend looking for an appropriate ActiveX control that displays bitmaps well. CVI (version 6.0) supports hosting ActiveX controls in your panel and I'm sure you could find an appropriate ActiveX control out there. There are ActiveX controls here like PolyImage that would work. Believe me, the time these controls would save over trying to do direct DC programming would be well worth the investment.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,885 Views)