Android Question Canvas Clear Problem

tufanv

Expert
Licensed User
Longtime User
Hello,

I an drawing a circle behind my moving x in my app, to delete all the previous circles and just draw the latest one i use :

B4X:
    Dim areaRect As Rect
    areaRect.Initialize(panelana.left,panelana.top,panelana.Width, panelana.Height)
    c.drawRect(areaRect, Colors.Transparent, True, 0)

   

    For i=1 To toplamtrafik
        c.DrawCircle(ucak(i).left,ucak(i).Top-10dip,5dip,Colors.White,True,1dip)
      
    Next
    panelana.Invalidate

this works perfect but changes my background color from black to blue , i think there is problem with my draw rect formula. If i dont fill it it doesnt remove the old dots.

This is hpw the code changes my black bg to blue :

https://s27.postimg.org/5064gm32r/Screenshot_2016_12_27_17_05_47.png

Why this code changes my bg color to blue ?=

Thanks
 

tufanv

Expert
Licensed User
Longtime User
What is panelana?
To erase a circle you can also redraw the 'old' circle with the background color or a transparent color if the background is transparent.
panelana is the panel where i initialized the canvas.
Sometimes my bg color changes so coloring the old circle to black may cause some problems for me
 
Upvote 0
Top