如何将图像添加到位图

时间:2012-04-23 07:45:38

标签: android bitmap imageview

嗨,我对这个Android开发都很陌生。

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

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

4 个答案:

答案 0 :(得分: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;

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

答案 1 :(得分: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.

答案 2 :(得分:0)

私有Paint绿色= new Paint();

private int greenx , greeny;

green.setColor(Color.GREEN);

    green.setAntiAlias(false);

    canvas.drawCircle(greenx,greeny,20,green);

如何在此代码中添加图像,如何用图像替换drawcircle?

答案 3 :(得分:-1)

尝试使用此代码:

<?php 
if (isset($_POST['link'])){
echo $_POST['link'];
} else{echo "error";}
?>