我想将我的位图转换为图像,而不是可绘制的图像,我已经看到了一些示例,他们正在将位图转换为可绘制的图像,但我需要 media.image(image) ,然后我用进一步的逻辑处理该图像。帮我解决这个问题简而言之,我需要将位图转换为图像。
Bitmap original_with_water_mark= addWatermark(original_image_bitmap,water_mark_bitmap,300);
我需要original_with_water_mark bitmap将其转换为要存储的图像。但我不知道如何将该位图转换为图像
因为在运行函数中,在开始时看到我需要mImage哪个是我必须存储的图像
@Override
public void run() {
ByteBuffer buffer = mImage.getPlanes()[0].getBuffer();
byte[] bytes = new byte[buffer.remaining()];
buffer.get(bytes);
FileOutputStream output = null;
try {
output = new FileOutputStream(mFile);
output.write(bytes);
} catch (IOException e) {
e.printStackTrace();
} finally {
mImage.close();
if (null != output) {
try {
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
慕姐4208626
慕娘9325324
相关分类