在从SD卡拍摄的照片上写下文字

时间:2011-12-08 08:14:23

标签: android

任何人都可以参考任何教程,在Android上的SD卡上拍摄的图像上写文字

2 个答案:

答案 0 :(得分:0)

您可以将EditText和Write放入其中,写完后首先将其转换为Bitmap,如

位图bmp = Bitmap.createBitmap(mEditText.getDrawingCache()); 现在您可以将创建的图像bmp添加到原始图像中,如下所示

这样调用:位图合并= combineImages(bgBitmap,bmp);

public Bitmap combineImages(Bitmap background, Bitmap foreground) { 

    int width = 0, height = 0;
    Bitmap cs;

    width = getWindowManager().getDefaultDisplay().getWidth();
    height = getWindowManager().getDefaultDisplay().getHeight();

    cs = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    Canvas comboImage = new Canvas(cs);
    background = Bitmap.createScaledBitmap(background, width, height, true);
    comboImage.drawBitmap(background, 0, 0, null);
    comboImage.drawBitmap(foreground, matrix, null);

    return cs;
}

答案 1 :(得分:0)

使用布局环绕图像..然后将文本视图添加到相同的布局