Hi, this might have been discussed in different contexts but my question is how to erase a circle that is drawn on an image which is assigned to a pinchandzoom view:
B4X:
Dim im As ImageView
Dim pnz As PinchZoomAndMove
dim canvas1 as canvas
'load bitmap onto image
bmp = LoadBitmap(File.DirAssets,"example.bmp")
im.Initialize("")
im.Bitmap = bmp
im.Gravity = Gravity.FILL
'assign image to pinchzoom view
pnz.Initialize(im,"pnz",1,0.5,3,4,False)
'initialize canvas on image
canvas1.Initialize(im)
' this circle gets drawn
canvas1.DrawCircle(x,y,2dip,Colors.Red,False,2dip)
' how to remove this circle from image????
So i want to be able to erase this circle (might be another canvas object, line, rectangle etc) and draw it somewhere else on the image.
Once you have drawn something onto an image you cannot erase it.
You should either:
- replace the image by the original one.
- add a separate transparent Panel on top of the image where you draw the circle and to erase it drawi the circle transparent as you tried.
Thanks Klaus. But I still want to be able to zoom in and out of the image (also pan) with the drawn circle so in a sense i want it to be part of the pinchzoom object. When the circle previously drawn is erased, the new circle can be drawn possibly at a different zoom level to a new location. Is this still possible with a transparent layer?