示例#1
0
        public static SKCanvas Create(SKRect bounds, SKWStream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            return(SKObject.Referenced(SKCanvas.GetObject(SkiaApi.sk_svgcanvas_create_with_stream(&bounds, stream.Handle)), stream));
        }
示例#2
0
        public static SKCanvas Create(SKRect bounds, SKXmlWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            return(SKObject.Referenced(SKCanvas.GetObject(SkiaApi.sk_svgcanvas_create_with_writer(&bounds, writer.Handle)), writer));
        }
示例#3
0
        public static SKCanvas Create(SKRect bounds, SKWStream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            // TODO: there seems to be a memory issue with things getting destroyed in the incorrect order
            //return SKObject.Referenced (SKObject.GetObject<SKCanvas> (SkiaApi.sk_svgcanvas_create_with_stream (&bounds, stream.Handle)), stream);

            var writer = new SKXmlStreamWriter(stream);

            return(SKObject.Owned(SKCanvas.GetObject(SkiaApi.sk_svgcanvas_create_with_writer(&bounds, writer.Handle)), writer));
        }
示例#4
0
        private static void DrawInternal(IntPtr d, void *context, IntPtr canvas)
        {
            var drawable = DelegateProxies.GetUserData <SKDrawable> ((IntPtr)context, out _);

            drawable.OnDraw(SKCanvas.GetObject(canvas, false));
        }
示例#5
0
 public SKCanvas BeginRecording(SKRect cullRect)
 {
     return(OwnedBy(SKCanvas.GetObject(SkiaApi.sk_picture_recorder_begin_recording(Handle, &cullRect), false), this));
 }
示例#6
0
 public SKCanvas BeginPage(float width, float height, SKRect content) =>
 OwnedBy(SKCanvas.GetObject(SkiaApi.sk_document_begin_page(Handle, width, height, &content), false), this);