当我在画布上用
//mTextPaint initialized while initialize the view.
mTextPaint = new TextPaint();
mTextPaint.setAntiAlias(true);
mTextPaint.setColor(color);
//iPath move/line to some point on onTouchEvent()
canvas.drawTextOnPath(text, iPath, 0, 0, mTextPaint);
当我使用,
try {
fos = new FileOutputStream(fname);
v.getDrawingCache().compress(Bitmap.CompressFormat.JPEG, 100, fos);
} catch (Exception ex) {
Toast.makeText(this, "Error Saving Image",
Toast.LENGTH_LONG).show();
}
注:
setDrawingCacheEnabled(true);
在初始化视图时添加。
任何关于为什么会发生这种情况以及如何克服这个问题的想法。