I have an image of 1920*1000 coming from the server, and I am loading this image in ImageView. Coordinates are coming in API also, which is calculated on basis of 1920*1000 screen size, using on click event.
I have to draw multiple images on my imageview using the coordinate coming from in the API, but when I am passing these coordinate and displaying multiple images on my imageview it’s not placing correctly like calculated in the actual image at the backend.
I have extended ImageView class and inside in onDraw(Canvas canvas) method, I am drawing the images.
canvas.save(); Bitmap marker = BitmapFactory.decodeResource(getResources(), R.drawable.atm); //Resize bitmap if you want to do Bitmap resizedBitmap = Bitmap.createScaledBitmap(marker, 50, 50, false); canvas.drawBitmap(resizedBitmap, list.get(i).x, list.get(i).y, null);
When I override ontouchevent, and find its drawing on screen size, not on actual image size, that’s why it’s not placing correctly.