سؤال

As is known, drawCircle(x, y, radius, paint); takes in the canvas coordinates, which may be different from the screen coordinates.

So if I just want to draw something on one particular point on the screen, how would I do that with that method?

I am asking this because the canvas may be moved or even zoomed, but I do NOT wish my circle to move. I want it to stay at that particular point on screen.

Here is the description of drawCircle() method.

هل كانت مفيدة؟

المحلول

It seems that there are no direct converting methods.

We have to convert it manually by the help of maths.

We can process the coordinates according to the properties, like translation or scaling or even rotation.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top