如何将图像添加到位图

问题描述 投票:1回答:2

嗨,每个人都是这个Android开发新手。

目前正在开发绘图应用程序,为绘制的图像添加图章/标签。所以我已经完成了绘图部分,所以现在我必须实现为绘制的图像添加图章/标签。

所以请帮我解决这个问题..

android bitmap imageview
2个回答
4
投票
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;

让你的问题更加具体化将有助于你。如果我理解正确,这段代码将帮助你绘制一个绘制画布的位图。


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.
© www.soinside.com 2019 - 2024. All rights reserved.