Alsing.Drawing.DrawingTools.DrawControl C# (CSharp) Method

DrawControl() public static method

public static DrawControl ( Control control, Bitmap b ) : bool
control System.Windows.Forms.Control
b System.Drawing.Bitmap
return bool
        public static bool DrawControl(Control control, Bitmap b)
        {
            Graphics g = Graphics.FromImage(b);
            IntPtr hdc = g.GetHdc();
            int i = NativeMethods.SendMessage(control.Handle, (int) WindowMessage.WM_PRINT, (int) hdc,
                                              (int) (WMPrintFlags.PRF_CLIENT | WMPrintFlags.PRF_ERASEBKGND));
            g.ReleaseHdc(hdc);
            g.Dispose();
            return i != 0;
        }

Same methods

DrawingTools::DrawControl ( Control control ) : Bitmap