Moving text and redrawing problems with the Image device

What I want, the text moves when a finger touches the image, and on the button, clicking redraws the existing image into a new one, which is superimposed on it.

It works great for v3.1 as well as for the emulator. but I tried to test the device v2.2, it meets the force Close.While it has all the support for Devices.Can you help me from here. It will be crucial in a few weeks. Thanks in advance.

///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);
}
+5
source share
1 answer

This will help to find out when the power operation will occur, as soon as the application starts, as soon as you touch before the text is ever drawn?


. , .

, OOM
redrawImage, , :

Bitmap bm = BitmapFactory.decodeFile(path,options);

. bm , .

0

All Articles