void DisplayClipOp(SKCanvas canvas, SKRect rect, SKClipOperation clipOp)
        {
            float textSize = textPaint.TextSize;

            canvas.DrawText(clipOp.ToString(), rect.MidX, rect.Top + textSize, textPaint);
            rect.Top += textSize;

            float radius  = 0.9f * Math.Min(rect.Width / 3, rect.Height / 2);
            float xCenter = rect.MidX;
            float yCenter = rect.MidY;

            canvas.Save();

            using (SKPath path1 = new SKPath())
            {
                path1.AddCircle(xCenter - radius / 2, yCenter, radius);
                canvas.ClipPath(path1);

                using (SKPath path2 = new SKPath())
                {
                    path2.AddCircle(xCenter + radius / 2, yCenter, radius);
                    canvas.ClipPath(path2, clipOp);

                    canvas.DrawPaint(fillPaint);
                }
            }

            canvas.Restore();
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public void ClipPath(SKPath path, SKClipOperation operation = SKClipOperation.Intersect, bool antialias = false)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            SkiaApi.sk_canvas_clip_path_with_operation(Handle, path.Handle, operation, antialias);
        }
Beispiel #4
0
        public void ClipRoundRect(SKRoundRect rect, SKClipOperation operation = SKClipOperation.Intersect, bool antialias = false)
        {
            if (rect == null)
            {
                throw new ArgumentNullException(nameof(rect));
            }

            SkiaApi.sk_canvas_clip_rrect_with_operation(Handle, rect.Handle, operation, antialias);
        }
Beispiel #5
0
 public void ClipRect(SKRect rect, SKClipOperation operation = SKClipOperation.Intersect, bool antialias = false)
 {
     SkiaApi.sk_canvas_clip_rect_with_operation(Handle, ref rect, operation, antialias);
 }
Beispiel #6
0
 public void ClipRoundRect(SKRoundRect rect, SKClipOperation operation)
 {
     rect.Transform(SKMatrix.CreateScale(CurrentState.ScaleX, CurrentState.ScaleY));
     Canvas.ClipRoundRect(rect, operation, true);
 }
Beispiel #7
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);
		}
Beispiel #8
0
 public void ClipPath(SKPath path, SKClipOperation operation)
 {
     path.Transform(SKMatrix.CreateScale(CurrentState.ScaleX, CurrentState.ScaleY));
     Canvas.ClipPath(path, operation);
 }
Beispiel #9
0
		public void ClipPath (SKPath path, SKClipOperation operation = SKClipOperation.Intersect, bool antialias = false)
		{
			if (path == null)
				throw new ArgumentNullException (nameof (path));
			
			SkiaApi.sk_canvas_clip_path_with_operation (Handle, path.Handle, operation, antialias);
		}
Beispiel #10
0
		public void ClipRect (SKRect rect, SKClipOperation operation = SKClipOperation.Intersect, bool antialias = false)
		{
			SkiaApi.sk_canvas_clip_rect_with_operation (Handle, ref rect, operation, antialias);
		}
Beispiel #11
0
		public extern static void sk_canvas_clip_region(sk_canvas_t t, sk_region_t region, SKClipOperation op);
Beispiel #12
0
		public extern static void sk_canvas_clip_path_with_operation(sk_canvas_t t, sk_path_t cpath, SKClipOperation op, bool doAA);
Beispiel #13
0
		public extern static void sk_canvas_clip_rect_with_operation(sk_canvas_t t, ref SKRect crect, SKClipOperation op, bool doAA);