Helllo, I am loading image scale it to screen size and after that user
can draw some text on it using his hand. After that user can save it
to SD card. I need to save it to same width and height as original
image has. For others sameple image it is working fine. But when i am
loading the image captured by camera and once i draw something on
draw. I try to scale image back to original height and width but it is
giving Exception "Out of Memory Exception" for all the images captured
by camera. The code is as follow.

private void saveView(View view) {
                Bitmap b = Bitmap.createBitmap(view.getWidth(), 
view.getHeight(),
                                Bitmap.Config.ARGB_8888);
                String filePath="/sdcard/";
                Canvas c = new Canvas(b);


                view.draw(c);
                float scaleHeight=((float)getHeight()/b.getHeight());
                float scaleWidth=((float)getWidth()/b.getWidth());
                Matrix matrix=new Matrix();
                matrix.postScale(scaleWidth, scaleHeight);
                Log.e("getWidth()", ":"+getWidth());
                Log.e("getHeight()", ":"+getHeight());

              **//Giving Exception at below Line as i am trying to
scat it to origenal size.
                b=Bitmap.createBitmap(b,
0,0,b.getWidth(),b.getHeight(),matrix,true);**


Hope to hear soon from you. My problem is it is not working for any
image taken by camera for others sample image it is working.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to