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); }
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); }
// 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); }
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)); }
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)); } }
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)); } }
public SKRegion(SKRegion region) : this() { SetRegion(region); }
public bool SetRegion(SKRegion region) { if (region == null) throw new ArgumentNullException (nameof (region)); return SkiaApi.sk_region_set_region(Handle, region.Handle); }
public bool Intersects(SKRegion region) { if (region == null) throw new ArgumentNullException (nameof (region)); return SkiaApi.sk_region_intersects(Handle, region.Handle); }
public bool Op(SKPath path, SKRegionOperation op) { using (var pathRegion = new SKRegion(path)) { return(Op(pathRegion, op)); } }
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); }
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)); }
public bool Set(SKRegion region) { return(SkiaApi.sk_region_set(Handle, region.Handle)); }
public bool Intersects(SKRegion region) { return(SkiaApi.sk_region_intersects(Handle, region.Handle)); }
public bool Contains(SKRegion src) { return(SkiaApi.sk_region_contains(Handle, src.Handle)); }
public bool Op(SKRegion region, SKRegionOperation op) { return(SkiaApi.sk_region_op2(Handle, region.Handle, op)); }
public bool Op(SKRegion region, SKRegionOperation op) { return SkiaApi.sk_region_op2(Handle, region.Handle, op); }
public bool Op(SKRegion region, SKRegionOperation op) => SkiaApi.sk_region_op2(Handle, region.Handle, op);
public SKRegion(SKRegion region) : this(SkiaApi.sk_region_new2(region.Handle), true) { }
public bool Contains(SKRegion src) { if (src == null) throw new ArgumentNullException (nameof (src)); return SkiaApi.sk_region_contains(Handle, src.Handle); }