0
我在地圖上畫了一堆圖標。其實這些圖標來自旋轉的相同圖像。但在地圖上,圖像呈現兩種不同的尺寸,我不知道爲什麼。這是結果看起來是這樣的:http://orangesoftware.net/iconmap.pngAndroid,旋轉18x18像素的圓圈圖標,結果:不同大小的圖標?
圖像文件看起來是這樣的:http://orangesoftware.net/arrow18.png
旋轉圖標代碼:
Matrix mtx = new Matrix();
mtx.postRotate(unit.heading);
Bitmap bmp = BitmapFactory.decodeResource(getResources(),
R.drawable.arrow18);
Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(),
bmp.getHeight(), mtx, true);
BitmapDrawable bmd = new BitmapDrawable(rotatedBMP);
任何神奇的見解讚賞,感謝
謝謝,但我沒有ImageView,至少沒有一個我知道的... – Gerry
什麼是你的位圖? –
android.graphics.drawable.Drawable – Gerry