public static void SetClipperCanvas(this EvasObject target, SKClipperView clipper) { if (target != null && clipper.ClippingRequired) { var realHandle = elm_object_part_content_get(clipper, "elm.swallow.content"); target.SetClip(null); // To restore original image evas_object_clip_set(target, realHandle); } }
protected override void OnElementChanged(ElementChangedEventArgs <Layout> e) { base.OnElementChanged(e); _clipper = new SKClipperView(Forms.NativeParent); _clipper.Show(); _clipper.PassEvents = true; _clipper.PaintSurface += OnCliperPaint; Control.Children.Add(_clipper); BackgroundCanvas?.StackAbove(_clipper); }
public static void SetClipperCanvas(this VisualElement target, SKClipperView clipper) { if (target != null && clipper.ClippingRequired) { var nativeView = Platform.GetOrCreateRenderer(target)?.NativeView; var realHandle = elm_object_part_content_get(clipper, "elm.swallow.content"); nativeView?.SetClip(null); // To restore original image evas_object_clip_set(nativeView, realHandle); } }
protected override void OnElementChanged(ElementChangedEventArgs <TView> e) { if (Control == null) { SetNativeControl(new Native.Canvas(Forms.NativeParent)); Control.Show(); Control.LayoutUpdated += OnLayout; Control.Children.Add(RealNativeView); } _backgroundCanvas = new Lazy <SKCanvasView>(() => { var canvas = new SKCanvasView(Forms.NativeParent); canvas.PassEvents = true; canvas.PaintSurface += OnBackgroundPaint; canvas.Show(); Control.Children.Add(canvas); canvas.Lower(); RealNativeView?.RaiseTop(); return(canvas); }); _clipper = new Lazy <SKClipperView>(() => { var clipper = new SKClipperView(Forms.NativeParent); clipper.PassEvents = true; clipper.PaintSurface += OnClipperPaint; clipper.Show(); Control.Children.Add(clipper); clipper.Lower(); RealNativeView?.RaiseTop(); return(clipper); }); base.OnElementChanged(e); }