Exemplo n.º 1
0
        public override void DrawInContext(CGContext ctx)
        {
            base.DrawInContext(ctx);

            // create the skia context
            SKImageInfo info;
            var         surface = drawable.CreateSurface(Bounds, ContentsScale, out info);

            // draw on the image using SKiaSharp
            DrawInSurface(surface, info);
            SKDelegate?.DrawInSurface(surface, info);

            // draw the surface to the context
            drawable.DrawSurface(ctx, Bounds, info, surface);
        }
Exemplo n.º 2
0
        public override void DrawRect(CGRect dirtyRect)
        {
            base.DrawRect(dirtyRect);

            var ctx = NSGraphicsContext.CurrentContext.CGContext;

            // create the skia context
            SKImageInfo info;
            var         surface = drawable.CreateSurface(Bounds, Window.BackingScaleFactor, out info);

            // draw on the image using SKiaSharp
            DrawInSurface(surface, info);

            // draw the surface to the context
            drawable.DrawSurface(ctx, Bounds, info, surface);
        }
Exemplo n.º 3
0
        public override void Draw(CGRect rect)
        {
            base.Draw(rect);

            if (designMode)
            {
                return;
            }

            var ctx = UIGraphics.GetCurrentContext();

            // create the skia context
            SKImageInfo info;
            var         surface = drawable.CreateSurface(Bounds, ContentScaleFactor, out info);

            // draw on the image using SKiaSharp
            DrawInSurface(surface, info);

            // draw the surface to the context
            drawable.DrawSurface(ctx, Bounds, info, surface);
        }