5
我想要什么,文本正在被移动以与手指触摸在图像上,点击按钮重绘现有的图像转换成一个新的这是贴在它的文本。移动文本和重绘影像设备发出
它工作得很好V3.1以及对模拟器。 但我试图V2.2设备上测试时它对于Devices.Can大家帮我出here.Its的会是在几个关键weeks.Thanks事先都支持ForSE召开前夕Close.While。
///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加载为可变。只有位图代理应该是可变的 –