예제 #1
0
        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)));
        }
예제 #2
0
 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,
 };
예제 #3
0
 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,
     });
 }
예제 #4
0
파일: SKSVG.cs 프로젝트: squens/SkiaSharp
        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));
        }