示例#1
0
        public void ToolkitExpose(Graphics graphics)
        {
            IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink;

            if (null != co)
            {
                co.ToolkitExpose(graphics);
            }
        }
示例#2
0
 // Handle a paint event from Xsharp.
 protected override void OnPaint(Xsharp.Graphics graphics)
 {
     if (sink != null)
     {
         System.Drawing.Region clip = RegionToDrawingRegion(graphics.ExposeRegion);
         DrawingGraphics       g    = new DrawingGraphics(toolkit, graphics);
         using (System.Drawing.Graphics gr =
                    ToolkitManager.CreateGraphics(g, clip))
         {
             sink.ToolkitExpose(gr);
         }
     }
 }
示例#3
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());
     }
 }