2012-04-23 206 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.