0
我在保存繪製的畫布圖像時遇到問題。代碼如下:安卓畫布繪圖
public void save_it(File file)
{
String fname = file.getAbsolutePath();
MyView mv =new MyView(this);
FileOutputStream fos = null;
try{
fos = new FileOutputStream(fname);
mv.myBitmap.compress(CompressFormat.JPEG, 100, fos);
Toast.makeText(this,"Image Saved", 2000).show();
}
catch(Exception e){
Toast.makeText(this,"Error Saving Image", 2000).show();
Log.i("DAVE","stacktrace is " + e);
}
有什麼問題?堆棧跟蹤在哪裏?什麼是「MyView」?它的'myBitmap'字段是否在施工時被初始化? (P.S .:請使用三參數Log方法:'Log.i(「DAVE」,「stacktrace following」,e);' – 2012-03-25 15:54:19