如果你有2張圖片(大小相同的或不它是由U),你想在騎一個圖像到另一個圖像,你可以做如下:
// 2 bitmap images are : Bitmap image1, image2. You know how to get it right?
image1 = image1.copy(Config.ARGB_8888, true);
image2 = image2.copy(config.ARGB_8888, true);
//Get color at the pixel (0,0)
int color = image2.getPixel(0,0);
//Set the color of pixel (0,0) of image2 to same color with pixel (0,0) of image 1
image2.setPixel(0,0,color);
注意,2圖像必須有相同的配置!
如果你想畫在你的地圖:
//Your Bitmap map must config like above
Canvas canvas = new Canvas(map);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setAntiAlias(true);
// Draw yourMakerBitmap from pixel(0,0) of your map
canvas.drawBitmap(yourMakerBitmap, 0, 0, paint);
你打電話canvas.drawBitmap(...)
後,您map
將有maker
超過它。現在你可以用與maker
做任何你喜歡的事!
我在哪種佈局中顯示此位圖圖像? – Rahul