clear canvas

PaulR

Active Member
Licensed User
Longtime User
You draw a transparent rectangle over the bit you want to clear. Then you need to call Invalidate for the Panel containing the Canvas for just it to redraw, or Invalidate the Activity to redraw everything....
B4X:
Dim areaRect As Rect
areaRect.Initialize(0,0,canvasWidth, canvasHeight)
myCanvas.drawRect(areaRect, Colors.Transparent, True, 0)

canvasParentPanelName.Invalidate

'or canvasParentPanelName.Invalidate2(areaRect) to redraw just that area in that Panel
'or Activity.Invalidate or Activity.Invalidate2(areaRect) to redraw not just that Panel
 
Upvote 0
Top