Esempio n. 1
0
 // WM_PAINT Message
 internal void Paint()
 {
     Win32.Api.PAINTSTRUCT myPS = new System.Drawing.Win32.Api.PAINTSTRUCT();
     hdc = Win32.Api.BeginPaint(hwnd, ref myPS);
     if (sink != null)
     {
         DrawingGraphics         g    = new DrawingGraphics(toolkit, hdc);
         Region                  clip = new Region(Rectangle.FromLTRB(myPS.rcPaintLeft, myPS.rcPaintTop, myPS.rcPaintRight, myPS.rcPaintBottom));
         System.Drawing.Graphics gr   = ToolkitManager.CreateGraphics(g, clip);
         try
         {
             sink.ToolkitExpose(gr);
         }
         finally
         {
             // EndPaint deletes the hdc but that doesnt matter.
             Win32.Api.EndPaint(hwnd, ref myPS);
             gr.Dispose();
         }
         //Console.WriteLine( "DrawingWindow.Paint "+ sink +","+gr.ClipBounds.ToString());
     }
 }
	// WM_PAINT Message
	internal void Paint()
	{
		Win32.Api.PAINTSTRUCT myPS = new System.Drawing.Win32.Api.PAINTSTRUCT();
		hdc = Win32.Api.BeginPaint(hwnd, ref myPS );
		if( sink != null )
		{
			DrawingGraphics g = new DrawingGraphics(toolkit, hdc);
			Region clip = new Region(Rectangle.FromLTRB(myPS.rcPaintLeft, myPS.rcPaintTop, myPS.rcPaintRight, myPS.rcPaintBottom));
			System.Drawing.Graphics gr = ToolkitManager.CreateGraphics(g, clip);
			try
			{
				sink.ToolkitExpose(gr);
			}
			finally
			{
				// EndPaint deletes the hdc but that doesnt matter.
				Win32.Api.EndPaint( hwnd, ref myPS);
				gr.Dispose();
			}
			//Console.WriteLine( "DrawingWindow.Paint "+ sink +","+gr.ClipBounds.ToString());
		}
	}