Osmdroid 中图标中心点坐标获取方法 - 简明指南
要获得图标的中心点坐标,可以使用以下方法:\n\n1. 假设图标左上角的坐标为(left,top),图标的宽度为width,高度为height。\n2. 图标的中心点坐标为(centerX,centerY),其中centerX = left + (width / 2),centerY = top + (height / 2)。\n\n因此,根据给定的图标坐标值X和Y,可以通过以下方式获得图标的中心点坐标:\n\njava\nint x = X - (rotatedBitmap.getWidth() / 2);\nint y = Y - (rotatedBitmap.getHeight() / 2);\nint centerX = x + (rotatedBitmap.getWidth() / 2);\nint centerY = y + (rotatedBitmap.getHeight() / 2);\n\n\n这样,centerX和centerY就是图标的中心点坐标。
原文地址: http://www.cveoy.top/t/topic/psHH 著作权归作者所有。请勿转载和采集!