My query is based on this post too
I draw on an image with list items to highlight specific item. I was developing the app testing on Samsung Galaxy Note 8 having resolution 1440 x 2960. It works for me as expected in Note 8. But when I tested with another device, the highlight goes weird. As the resolution changed, it goes to wrong place.
So what is the best way to do draw on image considering multiple screen resolutions.
canvas.DrawLine(150, 400, 1300, 400, thickLinePaint);
As the canvas.DrawLine
receives the parameters in coordinates
, how can convert to pixels so that the highlighting can work on all devices.
Please have a look at the below tests:
On Samsung Galaxy Note 8 ( 1440 x 2960 )
.
.
.
.
On Google Pixel 2 ( 1080 x 1920)
Edit: When I inquired myImage.X & .Y, myCanvas.X & .Y, both gives 0. But as we see in the above screen shots, its not at 0.