public static SKCanvas Create(SKRect bounds, SKXmlWriter writer) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } return(SKObject.GetObject <SKCanvas> (SkiaApi.sk_svgcanvas_create(&bounds, writer.Handle))); }
public static SKImageInfo ToManaged(ref SKImageInfoNative native) => new SKImageInfo { ColorSpace = SKObject.GetObject <SKColorSpace> (native.colorspace), Width = native.width, Height = native.height, ColorType = native.colorType, AlphaType = native.alphaType, };
public static SKImageInfo ToManaged(ref SKImageInfoNative native) { return(new SKImageInfo { ColorSpace = SKObject.GetObject <SKColorSpace> (native.fColorSpace), Width = native.fWidth, Height = native.fHeight, ColorType = native.fColorType, AlphaType = native.fAlphaType, }); }
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(SKObject.GetObject <SKCanvas> (SkiaApi.sk_svgcanvas_create_with_writer(&bounds, writer.Handle)), writer)); }