Exemple #1
0
        protected override void OnPaintSurface(SKPaintSurfaceEventArgs e)
        {
            //     base.OnPaintSurface(e);
            // }

            //  protected override void OnPaintSurface(SKPaintGLSurfaceEventArgs e)
            //  {

            if (lastrender.AddMilliseconds(30) > DateTime.Now)
            {
                return;
            }

            base.OnPaintSurface(e);

            lastrender = DateTime.Now;
            var start = DateTime.Now;

            pendingredraw = false;
            if (!started)
            {
                started = true;
                MySKGLView_SizeChanged(null, null);
            }

            e.Surface.Canvas.Clear(SKColors.AliceBlue);

            var sk = new Graphics(e.Surface);

            OnPaint(new PaintEventArgs(sk, ClientRectangle));
            sk.Flush();

            System.Diagnostics.Debug.WriteLine(this.GetType() + " OnPaintSurface " + (DateTime.Now - start).TotalSeconds);
        }
Exemple #2
0
        private void SKGLView_OnPaintSurface(object sender, SKPaintGLSurfaceEventArgs e)
        {
            e.Surface.Canvas.Clear(SKColors.AliceBlue);

            e.Surface.Canvas.DrawRect(10, 10, 50, 50, new SKPaint()
            {
                StrokeWidth = 2, Color = SKColors.Red
            });

            e.Surface.Canvas.DrawText(touchpoint.ToString(), 80, 20, new SKPaint()
            {
                TextSize = 16, StrokeWidth = 2
            });

            var g = new Graphics(e.Surface);



            g.DrawRectangle(new Pen(Color.Red), touchpoint.X, touchpoint.Y, 12, 12);



            e.Surface.Canvas.DrawText(base.Width + " " + base.Height, 80, 40,
                                      new SKPaint()
            {
                TextSize = 16, StrokeWidth = 2
            });

            //e.Surface.Canvas.DrawText(SkglView.CanvasSize.ToString(), 80, 60,new SKPaint() {TextSize = 16, StrokeWidth = 2});

            e.Surface.Canvas.Flush();

            //AGauge.Value++;
        }
        protected override void OnPaintSurface(SKPaintGLSurfaceEventArgs e)
        {
            if (!started)
            {
                started = true;
                MySKGLView_SizeChanged(null, null);
            }

            e.Surface.Canvas.Clear(SKColors.AliceBlue);
            base.OnPaintSurface(e);
            var sk = new Graphics(e.Surface);

            OnPaint(new PaintEventArgs(sk, ClientRectangle));
        }