Inheritance: SKObject
Exemple #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); 
		}
Exemple #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); }
Exemple #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);
        }
Exemple #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));
 }
Exemple #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));
            }
        }
Exemple #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));
            }
        }
Exemple #7
0
 public SKRegion(SKRegion region)
     : this()
 {
     SetRegion(region);
 }
Exemple #8
0
		public bool SetRegion(SKRegion region)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));
			return SkiaApi.sk_region_set_region(Handle, region.Handle);
		}
Exemple #9
0
		public bool Intersects(SKRegion region)
		{
			if (region == null)
				throw new ArgumentNullException (nameof (region));
			return SkiaApi.sk_region_intersects(Handle, region.Handle);
		}
Exemple #10
0
 public bool Op(SKPath path, SKRegionOperation op)
 {
     using (var pathRegion = new SKRegion(path)) {
         return(Op(pathRegion, op));
     }
 }
Exemple #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);
		}
Exemple #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);
		}
		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));
		}
Exemple #14
0
 public bool Set(SKRegion region)
 {
     return(SkiaApi.sk_region_set(Handle, region.Handle));
 }
Exemple #15
0
 public bool Intersects(SKRegion region)
 {
     return(SkiaApi.sk_region_intersects(Handle, region.Handle));
 }
Exemple #16
0
 public bool Contains(SKRegion src)
 {
     return(SkiaApi.sk_region_contains(Handle, src.Handle));
 }
Exemple #17
0
 public bool Op(SKRegion region, SKRegionOperation op)
 {
     return(SkiaApi.sk_region_op2(Handle, region.Handle, op));
 }
Exemple #18
0
		public bool Op(SKRegion region, SKRegionOperation op)
		{
			return SkiaApi.sk_region_op2(Handle, region.Handle, op);
		}
Exemple #19
0
 public bool Op(SKRegion region, SKRegionOperation op) =>
 SkiaApi.sk_region_op2(Handle, region.Handle, op);
Exemple #20
0
		public SKRegion(SKRegion region)
			: this(SkiaApi.sk_region_new2(region.Handle), true)
		{
		}
Exemple #21
0
 public SKRegion(SKRegion region)
     : this(SkiaApi.sk_region_new2(region.Handle), true)
 {
 }
Exemple #22
0
		public bool Contains(SKRegion src)
		{
			if (src == null)
				throw new ArgumentNullException (nameof (src));
			return SkiaApi.sk_region_contains(Handle, src.Handle); 
		}