2014-02-17 35 views

回答

2
public static Bitmap getBitmapOverlay(Bitmap bmp1, Bitmap bmp2, int left, int top) { 
    Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(), bmp1.getConfig()); 
    Canvas canvas = new Canvas(bmOverlay);  
    canvas.drawBitmap(bmp1, 0, 0, null); 
    canvas.drawBitmap(bmp2, left, top, null); 
    return bmOverlay; 
} 


//using getBitmapOverlay, u need read big image ->myBitmap 
//read bigSale image -> nextBitmap 
//u can change left, top 
myBitmap = getBitmapOverlay(myBitmap, nextBitmap, 0, 0)); 
myImage.setImageBitmap(myBitmap); 
+0

感謝您的支持! 顯示最佳Saler圖標,但它在圖像中,如何將圖標移動到父級佈局的左側(有邊框) –

+0

在您的情況下,嘗試使用佈局 - http://stackoverflow.com/questions/3634496/android-image- over-image –

+0

它爲我工作,謝謝! Mìnhlàmđượcrồi,cảmơnbạnnhiềunha。 –