我的ImageView
,
onDraw(canvas)
我试过了:
canvas.drawBitmap(...);//draw an extremely large background 3264 * 2448 pixels
canvas.drawLine(...);//draw target
我的问题是,如何将这个画布保存为png?谢谢!
答案 0 :(得分:1)
从这里的问题: Drawing on Canvas and save image
imgView.setDrawingCacheEnabled(true);
Bitmap b = imgView.getDrawingCache();
FileOutputStream fos = null;
try {
fos = new FileOutputStream(getFileName());
} catch (FileNotFoundException e) {
e.printStackTrace();
}
b.compress(CompressFormat.PNG, 95, fos);
答案 1 :(得分:0)
您可以将视图缓存图像另存为png。