我已经使用以下代码创建了一个包含任何图像的地图:
icon_pin = BitmapFactory.decodeResource(getApplicationContext().getResources(), R.drawable.arrow);
int w = icon_pin.getWidth();
int h = icon_pin.getHeight();
Bitmap.Config conf = Bitmap.Config.ARGB_8888;
Bitmap bmp = Bitmap.createBitmap(w, h, conf);
final float centerX = w / 2.0f;
final float centerY = h / 2.0f;
Canvas canvas = new Canvas(bmp);
canvas.rotate(m.getDirection(), centerX, centerY);
canvas.drawBitmap(icon_pin, new Matrix(), null);
但是当我旋转图像时,结果非常粗糙(如本例中的绿色箭头:http: //img837.imageshack.us/img837/4624/screenshot2013052111381.png)
我做错了什么?有可能改善定义吗?