Inheritance: SKObject
Exemplo n.º 1
0
		public bool SetPath(SKPath path, SKRegion clip)
		{
			if (path == null)
				throw new ArgumentNullException (nameof (path));
			if (clip == null)
				throw new ArgumentNullException (nameof (clip));
			return SkiaApi.sk_region_set_path(Handle, path.Handle, clip.Handle); 
		}
Exemplo n.º 2
0
        public bool SetPath(SKPath path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            using var clip = new SKRegion();
            var rect = SKRectI.Ceiling(path.Bounds);

            if (!rect.IsEmpty)
                clip.SetRect(rect); }
Exemplo n.º 3
0
        // DrawRegion

        public void DrawRegion(SKRegion region, SKPaint paint)
        {
            if (region == null)
            {
                throw new ArgumentNullException(nameof(region));
            }
            if (paint == null)
            {
                throw new ArgumentNullException(nameof(paint));
            }
            SkiaApi.sk_canvas_draw_region(Handle, region.Handle, paint.Handle);
        }
Exemplo n.º 4
0
 public bool SetPath(SKPath path, SKRegion clip)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     if (clip == null)
     {
         throw new ArgumentNullException(nameof(clip));
     }
     return(SkiaApi.sk_region_set_path(Handle, path.Handle, clip.Handle));
 }
Exemplo n.º 5
0
        public bool SetPath(SKPath path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            using (var clip = new SKRegion()) {
                var rect = SKRectI.Ceiling(path.Bounds);
                if (!rect.IsEmpty)
                {
                    clip.SetRect(rect);
                }

                return(SkiaApi.sk_region_set_path(Handle, path.Handle, clip.Handle));
            }
        }
Exemplo n.º 6
0
        public bool SetPath(SKPath path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            using (var clip = new SKRegion()) {
                SKRect rect;
                if (path.GetBounds(out rect))
                {
                    var recti = new SKRectI(
                        (int)rect.Left,
                        (int)rect.Top,
                        (int)Math.Ceiling(rect.Right),
                        (int)Math.Ceiling(rect.Bottom));
                    clip.SetRect(recti);
                }

                return(SkiaApi.sk_region_set_path(Handle, path.Handle, clip.Handle));
            }
        }
Exemplo n.º 7
0
 public SKRegion(SKRegion region)
     : this()
 {
     SetRegion(region);
 }
Exemplo n.º 8
0
		public bool SetRegion(SKRegion region)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));
			return SkiaApi.sk_region_set_region(Handle, region.Handle);
		}
Exemplo n.º 9
0
		public bool Intersects(SKRegion region)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));
			return SkiaApi.sk_region_intersects(Handle, region.Handle);
		}
Exemplo n.º 10
0
 public bool Op(SKPath path, SKRegionOperation op)
 {
     using (var pathRegion = new SKRegion(path)) {
         return(Op(pathRegion, op));
     }
 }
Exemplo n.º 11
0
		public void DrawRegion (SKRegion region, SKPaint paint)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));
			if (paint == null)
				throw new ArgumentNullException (nameof (paint));
			SkiaApi.sk_canvas_draw_region (Handle, region.Handle, paint.Handle);
		}
Exemplo n.º 12
0
		public void ClipRegion (SKRegion region, SKClipOperation operation = SKClipOperation.Intersect)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));

			SkiaApi.sk_canvas_clip_region (Handle, region.Handle, operation);
		}
Exemplo n.º 13
0
		public static SKImageFilter CreateAlphaThreshold(SKRegion region, float innerThreshold, float outerThreshold, SKImageFilter input = null)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));
			return GetObject<SKImageFilter>(SkiaApi.sk_imagefilter_new_alpha_threshold(region.Handle, innerThreshold, outerThreshold, input == null ? IntPtr.Zero : input.Handle));
		}
Exemplo n.º 14
0
 public bool Set(SKRegion region)
 {
     return(SkiaApi.sk_region_set(Handle, region.Handle));
 }
Exemplo n.º 15
0
 public bool Intersects(SKRegion region)
 {
     return(SkiaApi.sk_region_intersects(Handle, region.Handle));
 }
Exemplo n.º 16
0
 public bool Contains(SKRegion src)
 {
     return(SkiaApi.sk_region_contains(Handle, src.Handle));
 }
Exemplo n.º 17
0
 public bool Op(SKRegion region, SKRegionOperation op)
 {
     return(SkiaApi.sk_region_op2(Handle, region.Handle, op));
 }
Exemplo n.º 18
0
		public bool Op(SKRegion region, SKRegionOperation op)
		{
			return SkiaApi.sk_region_op2(Handle, region.Handle, op);
		}
Exemplo n.º 19
0
 public bool Op(SKRegion region, SKRegionOperation op) =>
 SkiaApi.sk_region_op2(Handle, region.Handle, op);
Exemplo n.º 20
0
		public SKRegion(SKRegion region)
			: this(SkiaApi.sk_region_new2(region.Handle), true)
		{
		}
Exemplo n.º 21
0
 public SKRegion(SKRegion region)
     : this(SkiaApi.sk_region_new2(region.Handle), true)
 {
 }
Exemplo n.º 22
0
		public bool Contains(SKRegion src)
		{
			if (src == null)
				throw new ArgumentNullException (nameof (src));
			return SkiaApi.sk_region_contains(Handle, src.Handle); 
		}