コード例 #1
0
ファイル: CanvasBackend.cs プロジェクト: m13253/xwt
		private void Render (System.Windows.Media.DrawingContext dc)
		{
			if (BackgroundColorSet) {
				SolidColorBrush mySolidColorBrush = new SolidColorBrush ();
				mySolidColorBrush.Color = BackgroundColor.ToWpfColor ();
				Rect myRect = new Rect (0, 0, Widget.ActualWidth, Widget.ActualHeight);
				dc.DrawRectangle (mySolidColorBrush, null, myRect);
			}
			
			var ctx = new Xwt.WPFBackend.DrawingContext (dc, Widget.GetScaleFactor ());
            ctx.Context.PushClip(new RectangleGeometry(new Rect(0, 0, Widget.ActualWidth, Widget.ActualHeight)));
            CanvasEventSink.OnDraw(ctx, new Rectangle(0, 0, Widget.ActualWidth, Widget.ActualHeight));
		}
コード例 #2
0
ファイル: CanvasBackend.cs プロジェクト: wesreid/xwt
        private void Render(System.Windows.Media.DrawingContext dc)
        {
            if (BackgroundColorSet)
            {
                SolidColorBrush mySolidColorBrush = new SolidColorBrush();
                mySolidColorBrush.Color = BackgroundColor.ToWpfColor();
                Rect myRect = new Rect(0, 0, Widget.ActualWidth, Widget.ActualHeight);
                dc.DrawRectangle(mySolidColorBrush, null, myRect);
            }

            var ctx = new Xwt.WPFBackend.DrawingContext(dc, Widget.GetScaleFactor());

            CanvasEventSink.OnDraw(ctx, new Rectangle(0, 0, Widget.ActualWidth, Widget.ActualHeight));
        }
コード例 #3
0
        private void Render(System.Windows.Media.DrawingContext dc)
        {
            // delay drawing until all parents are registered and we can
            // get a window which is required for many drawing operations
            if (Frontend.ParentWindow == null)
            {
                QueueDraw();
                return;
            }

            if (BackgroundColorSet)
            {
                SolidColorBrush mySolidColorBrush = new SolidColorBrush();
                mySolidColorBrush.Color = BackgroundColor.ToWpfColor();
                Rect myRect = new Rect(0, 0, Widget.ActualWidth, Widget.ActualHeight);
                dc.DrawRectangle(mySolidColorBrush, null, myRect);
            }

            var ctx = new Xwt.WPFBackend.DrawingContext(dc, Widget.GetScaleFactor());

            ctx.Context.PushClip(new RectangleGeometry(new Rect(0, 0, Widget.ActualWidth, Widget.ActualHeight)));
            CanvasEventSink.OnDraw(ctx, new Rectangle(0, 0, Widget.ActualWidth, Widget.ActualHeight));
        }
コード例 #4
0
        private void Render(System.Windows.Media.DrawingContext dc)
        {
            var dirtyRectangle = queueRect;

            queueRect = Rectangle.Zero;
            // disabled! queueRect allways zero!
            if (queueRect == Rectangle.Zero)
            {
                dirtyRectangle = new Rectangle(0, 0, Widget.ActualWidth, Widget.ActualHeight);
            }
            var dirtyRect = dirtyRectangle.ToWpfRect();

            if (BackgroundColorSet)
            {
                SolidColorBrush mySolidColorBrush = new SolidColorBrush();
                mySolidColorBrush.Color = BackgroundColor.ToWpfColor();
                dc.DrawRectangle(mySolidColorBrush, null, dirtyRect);
            }

            var ctx = new Xwt.WPFBackend.DrawingContext(dc, Widget.GetScaleFactor());

            ctx.Context.PushClip(new RectangleGeometry(dirtyRect));
            CanvasEventSink.OnDraw(ctx, dirtyRectangle);
        }
コード例 #5
0
        private void Render(System.Windows.Media.DrawingContext dc)
        {
            // delay drawing until all parents are registered and we can
            // get a window which is required for many drawing operations
            if (Frontend.ParentWindow == null) {
                QueueDraw ();
                return;
            }

            if (BackgroundColorSet) {
                SolidColorBrush mySolidColorBrush = new SolidColorBrush ();
                mySolidColorBrush.Color = BackgroundColor.ToWpfColor ();
                Rect myRect = new Rect (0, 0, Widget.ActualWidth, Widget.ActualHeight);
                dc.DrawRectangle (mySolidColorBrush, null, myRect);
            }

            var ctx = new Xwt.WPFBackend.DrawingContext (dc, Widget.GetScaleFactor ());
            ctx.Context.PushClip(new RectangleGeometry(new Rect(0, 0, Widget.ActualWidth, Widget.ActualHeight)));
            CanvasEventSink.OnDraw(ctx, new Rectangle(0, 0, Widget.ActualWidth, Widget.ActualHeight));
        }