I am trying to find information on how to change the coordinate system for a canvas. I have some vector data that I would like to draw on the canvas using things like circles and lines, but the data coordinate system does not match the canvas coordinate system.
Is there a way to match the units that I use for screens?
I draw an image that does not occupy the entire screen.
If I need to do my own calculations before each drawing call, how do I find the width and height of my ImageView?
Called getWidth () and getHeight () seem to return the entire size of the canvas, not the size of the ImageView, which doesn't help.
I see some kind of matrix, is that what will work for me?
I tried using the "public void scale (float sx, float sy)", but this is more like an increase in the pixel level, rather than a vector scale function, expanding each pixel. This means that if the dimensions are enlarged to fit the screen, the line thickness also increases.
Update:
After some research, I begin to think that there is no way to change the coordinate system to something else. I will need to match all my coordinates with the coordinates of pixel pixels and do this by changing each vector. Now getWidth () and getHeight () work better for me. I can say what was wrong, but I suspect that I cannot use these methods inside the constructor.
Mitch source
share