私は何をしたいのですか、イメージ上で指がタッチされた状態でテキストが移動しています。ボタンをクリックすると、既存のイメージがテキストとして貼り付けられた新しいイメージに再描画されます。イメージデバイスの問題を移動して再描画する
エミュレータと同様、v3.1でも問題なく動作します。 私はv2.2デバイスでテストしようとしましたが、forse Close.WhileはDevices.Canをサポートしています。ここから私を助けてくれます。数週間後には重要です。事前に感謝します。
///Redrawing the image & touchin Move of the Canvas with text
public void redrawImage(String path,float sizeValue,String textValue,int colorValue) {
BitmapFactory.Options options = new BitmapFactory.Options();
try {
options.inMutable = true;
} catch (Exception e) {
// TODO: handle exception
System.out.println("#############Error is======"+e.getMessage());
}
Bitmap bm = BitmapFactory.decodeFile(path,options);
proxy = Bitmap.createBitmap(bm.getWidth(), bm.getHeight(), Config.ARGB_8888);
Canvas c = new Canvas(proxy);
//Here, we draw the background image.
c.drawBitmap(bm, new Matrix(), null);
Paint paint = new Paint();
paint.setColor(colorValue); // Text Color
paint.setStrokeWidth(30); // Text Size
paint.setTextSize(sizeValue);
System.out.println("Values passing=========="+someGlobalXvariable+", "+someGlobalYvariable+", "
+sizeValue+", "+textValue);
//Here, we draw the text where the user last touched.
c.drawText(textValue, someGlobalXvariable, someGlobalYvariable, paint);
popImgae.setImageBitmap(proxy);
}
logcatからエラーログを投稿できますか? – Zelleriation
options.inMutable = true; APIレベル11以降:ビットマップbmをMutableとしてロードする必要はありません。ビットマッププロキシのみを変更可能 –