1

I am using canvas on mapview for custom marker I have draw multiple components in Canvas but I want to rotate only one component rotate not all the components rotate same time. canvas have his own builtin function canvas.rotate(degree); but when we sub components like canvas.drawRect, canvas.drawText or canvas.drawBitmap then how we use rotate drawRect. sorry for bad english... thanks in advance.

Muaz Ishfaq
  • 276
  • 1
  • 4
  • 17

1 Answers1

2

You can save Canas state and then restore its state to remove all modifications:

canvas.save();
canvas.rotate(degree);
canvas.drawText(...);
canvas.restore();

In this answer you can read more about point of managing cavas state.

Community
  • 1
  • 1
pawegio
  • 1,722
  • 3
  • 17
  • 29