10195 : How do I call PrintToHDC from C#?

Question

How do I call PrintToHDC from C#? The first argument asks for “aHDC” which
I don’t know what it is?

Answer

aHdc=(int)e.Graphics.GetHdc().ToInt32();
uw=0;
uh=0;
axphSchemaX1.PrintToHdc(aHdc,0,0,200,20,aScale,aScale,aStartCol,axphSchemaX1.Columns().Count()-1, axphSchemaX1.ScalerStart, axphSchemaX1.ScalerStop,axphSchemaX1.FlipView,ref uw,ref uh);
e.Graphics.ReleaseHdc((System.IntPtr)aHdc);

Note: PrintToDefault grabs the Device Context Handle (hdc) from the windows deault
printer and then uses PrintToHDC

Leave a Reply