1
我已經寫了代碼來繪製圖像上的文本其工作正常我捕獲圖像在potrait模式,但應用程序崩潰時,我在橫向模式捕獲圖像,我收到異常Java.lang .IllegalStateException:傳遞給帆布構造在畫布上畫圖片
Canvas canvas = new Canvas(photo);
Typeface tf = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setStyle(Style.FILL);
paint.setTypeface(tf);
paint.setColor(Color.WHITE);
paint.setStrokeWidth(12);
canvas.drawBitmap(photo, 0, 0, paint);
canvas.drawText(topaste, 10, 115, paint);
image.setImageBitmap(photo);
任何解釋爲什麼這隻發生在風景雖然嗎? – aaronmarino