int x = 1460;
int y = 800;
BitmapFactory.Options myOptions = new BitmapFactory.Options();
myOptions.inDither = true;
myOptions.inScaled = false;
myOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;// important
myOptions.inPurgeable = true;
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.mipmap.map, myOptions);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setColor(Color.BLUE);
Bitmap workingBitmap = Bitmap.createBitmap(bitmap);
Bitmap mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, true);
Canvas canvas = new Canvas(mutableBitmap);
canvas.drawCircle(x, y, 25, paint);
Bitmap currentPin = BitmapFactory.decodeResource(getResources(),
R.mipmap.pushpin_blue);
canvas.drawBitmap(currentPin, x, y, null);
我将大头针和圆形都放置在相同的xy坐标中,但如下图所示