-
Old Style Printer.hDC
Hi All,
I need to print the contents of a 3rd Party imaging control. In vb6 I could do this -
myControl.prnHDC = Printer.hDC
myControl.PrintImage
Printer.EndDoc
Any ideas how I can do this in .NET.
The .NET SDK tells me the old Printer.HDC property is no longer needed because the PrintDocument class is a device context itself.
I can't seem to find a way to hook the image data to the Graphics object either. If I do this -
myControl.hDC = e.Graphics.GetHDC
The IDE tells me it cannot convert a System.IntStr to an Integer. All of myControl's hdc properties are Integers.
Any help is greatly appreciated.
TIA
-
I think you mean IntPtr and not IntStr. You must have Option Strict On, which is a good thing though. This means you must explicitly convert the IntPtr to an integer, because implicit conversions are not allowed.
Try someting like this:
myControl.hDC = e.Graphics.GetHDC.ToInt32
-
Yes..I meant IntPtr (as you pointed out)
I'll give your advice a try.
Thanks.