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