2012-04-23 241 views
0

嗨,每一個新的這個android開發。如何將圖像添加到位圖

目前正在開發繪圖應用程序,添加郵票/標籤繪製image.so我已完成繪圖部分,所以現在我必須實現添加郵票/標籤繪製圖像。

所以,請幫助我這個..

+0

看看[這篇文章](http://stackoverflow.com/q/1540272/593709) – 2012-04-23 07:52:26

回答

3
Bitmap Rbitmap = Bitmap.createBitmap(bitmap).copy(Config.ARGB_4444, true); 
Canvas canvas = new Canvas(Rbitmap);    
canvas.drawBitmap(label, -9, Rbitmap.getHeight()-label.getHeight()-10, null); 
canvas.save(); 
return Rbitmap; 

使你的問題更具體一點會幫助你more.If我的理解是正確的這一段代碼將有助於你出去繪製一個位圖到繪製的畫布。

0

你可能是一個更具體一點,即張貼一些代碼來證明你有什麼得到更具體的答案。無論如何,你可以通過使用這樣的事情畫上另一個位圖的頂部位圖:

//You will have a Bitmap bottomBmp, a Bitmap topBmp and a Canvas canvas. 
//If you are inside an onDraw() method the canvas will be provided to you, otherwise you will have to create it yourself, use a mutable bitmap of the same size as the bottomBmp. 

canvas.drawBitmap(bottomBmp, 0, 0, null); //Draw the bottom bitmap in the upper left corner of the canvas without any special paint effects. 
canvas.drawBitmap(topBmp, 0, 0, null); //Draw the top bitmap over the bottom bitmap, change the zeroes to offset this bitmap.