You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently draw image at 1st layer, draw some paths on the 2nd layer. How to makeImageSnapshot only for 2nd layer?
Here is my short code:
constonDraw=useDrawCallback((_canvas,info)=>{// Draw Image on the first layer_canvas.drawImageRect(skimage,{x: 0,y: 0,width: skimage.width(),height: skimage.height(),},{x: my_x,y: my_x,width: my_width,height: my_height,},p,);letp=Skia.Paint();p.setAlphaf(0.5);p.setColorFilter(Skia.ColorFilter.MakeBlend(Skia.Color('red'),BlendMode.Modulate),);_canvas.saveLayer(p,{x: my_x,y: my_x,width: my_width,height: my_height,});// Draw some Paths on the second layer_canvas.current?.drawPath(myPath1.current.path,myPath2.current.paint,);_canvas.current?.drawPath(myPath1.current.path,myPath2.current.paint,);return(<SkiaViewref={skDrawRefasRefObject<SkiaView>}onDraw={onDraw}style={{// opacity: 0.5,// height: VIEW_HEIGHT,// width: VIEW_WIDTH,flex: 1,zIndex: 10,}}/>)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently draw image at 1st layer, draw some paths on the 2nd layer. How to
makeImageSnapshot
only for 2nd layer?Here is my short code:
thanks.
Beta Was this translation helpful? Give feedback.
All reactions