我的图标大小:mdpi 为 32x32,hdpi 为 48x48,xhdpi 为 64x64。在某些设备上一切正常。但是其他的……代码如下图
bmpOriginal = BitmapFactory.decodeResource(this.getResources(), R.drawable.on_green_icon);
int w = bmpOriginal.getWidth();
int h = bmpOriginal.getHeight();
Bitmap bmResult = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
Canvas tempCanvas = new Canvas(bmResult);
tempCanvas.rotate(f, bmpOriginal.getWidth()/2, bmpOriginal.getHeight()/2);
tempCanvas.drawBitmap(bmpOriginal, 0, 0, null);
BitmapDrawable bmd = new BitmapDrawable(bmResult);
LayerDrawable finalImage = new LayerDrawable(
new Drawable[]{bmd, new BitmapDrawable(bmResult)});
itemizedOverlay.addOverlayItem((int)(lat * 1E6), (int)(lng * 1E6), str_info, editDate, finalImage);