not able to create image and save except the type Bitmap.Config.RGB_565
<p>i have made simple application which load image in canvas scale it according to screen height and width and  after that user can write and draw something on it using his finger and once user complete its drawing. He should be able to save it. But i have to save the image as same width and height as original image.(not according to phone screen size). So i am scaling the image to its original height and width.  But it is only able to scale if i use Bitmap type 
Bitmap.Config.RGB_565 as it uses law memory(but very poor quality). For others type like Bitmap.Config.ALPHA_8, Bitmap.Config.ARGB_8888 it is giving MemoryOutOfException. The code to re size image to its original width and height is as follow. </p>

<p>public Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) {</p>

<pre><code>        int width = bm.getWidth();
        int height = bm.getHeight();
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;

        // create a matrix for the manipulation
        Matrix matrix = new Matrix();
        // resize the bit map
        matrix.postScale(scaleWidth, scaleHeight);
        // recreate the new Bitmap
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inTempStorage = new byte[16*1024];
        //bm.
        //BitmapFactory.decodeByteArray(bm.getRowBytes(), 0, length, opts)
        Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height,
                        matrix, false);


     //  return Bitmap.createScaledBitmap(bm, newWidth, newHeight, true);
        return resizedBitmap;
    }
</code></pre>

<p>The following is code to create blank bitmap on which i draw the content which is in my view and then i try to resize it.</p>

<p>Bitmap b = Bitmap.createBitmap(view.getWidth(), view.getHeight(),
                Bitmap.Config.RGB_565);</p>

<p>The main problem with Bitmap.Config.RGB_565 is the quality of image is very poor compare to original image which has very good quality. so i want to use Bitmap.Config.ARGB_8888 if possible. any suggestion and advise is more then welcome.</p>
