Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Solved] Clear SurfaceView

 
Alexander Schmidt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
I'm new in this Forum and I hope you can help me with a little SurfaceView problem.

An external Thread is calling doDraw:

The doDraw() in MySurfaceView

What I see now, is the image in the background and a line. But if the configuration of the line changes, i don't see the line "moving". There now is a line for every call of doDraw().

I found this in the DevGuide:
On each pass you retrieve the Canvas from the SurfaceHolder, the previous state of the Canvas will be retained. In order to properly animate your graphics, you must re-paint the entire surface. For example, you can clear the previous state of the Canvas by filling in a color with drawColor() or setting a background image with drawBitmap(). Otherwise, you will see traces of the drawings you previously performed.

But I have a background Image and it doesnt help.
So I tried

I even tried to draw a rectangle:

But it's not working.
And now I need your help ;)
 
Alexander Schmidt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved it.
I dont know why i use Path().
I have to use drawLine() instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic