Ejemplo n.º 1
0
        private void PerformWmPaint(ref Message m)
        {
            PAINTSTRUCT ps         = new PAINTSTRUCT();
            Rectangle   rectClient = ClientRectangle;
            IntPtr      hDC        = User32.BeginPaint(m.HWnd, ref ps);

            using (Graphics g = Graphics.FromHdc(hDC))
            {
                using (Bitmap bitmap1 = new Bitmap(rectClient.Width, rectClient.Height))
                {
                    using (Graphics graphics2 = Graphics.FromImage(bitmap1))
                    {
                        OnPaint(new PaintEventArgs(graphics2, rectClient));
                    }
                    g.DrawImageUnscaled(bitmap1, 0, 0);
                }
            }
            User32.EndPaint(m.HWnd, ref ps);
        }
Ejemplo n.º 2
0
 internal static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
Ejemplo n.º 3
0
 internal static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
Ejemplo n.º 4
0
 internal static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
Ejemplo n.º 5
0
 internal static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
Ejemplo n.º 6
0
 private void PerformWmPaint(ref Message m)
 {
     PAINTSTRUCT ps = new PAINTSTRUCT();
     Rectangle rectClient = ClientRectangle;
     IntPtr hDC = User32.BeginPaint(m.HWnd, ref ps);
     using (Graphics g = Graphics.FromHdc(hDC))
     {
         using (Bitmap bitmap1 = new Bitmap(rectClient.Width, rectClient.Height))
         {
             using (Graphics graphics2 = Graphics.FromImage(bitmap1))
             {
                 OnPaint(new PaintEventArgs(graphics2, rectClient));
             }
             g.DrawImageUnscaled(bitmap1, 0, 0);
         }
     }
     User32.EndPaint(m.HWnd, ref ps);
 }