Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
LinkBack Thread Tools
Old March 8th, 2010, 07:12 AM   #1 (permalink)
New Member
Thread Author (OP)
Join Date: Mar 2010
Posts: 1
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default saving Image


need a help urgent !!
I'm done with saving the image after capturing it
but I face another problem that the image is very small

and when i try to capatalize it , it become not clear

the code:
.setOnClickListener(new OnClickListener() {

void onClick(View v)

// create camera intent

Intent intent =
new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

//Grant permission to the camera activity to write the photo.

// start the camera intent and return the image



protectedvoid onActivityResult(int requestCode, int
resultCode, Intent data)
super.onActivityResult(requestCode, resultCode, data);

// if Activity was canceled, display a Toast message

if (resultCode == RESULT_CANCELED) {
Toast toast = Toast.makeText(
this,"camera cancelled", 10000);

// lets check if we are really dealing with a picture

if (requestCode == 1 && resultCode == RESULT_OK)
String timestamp = Long.toString(System.currentTimeMillis());
// get the picture

Bitmap mPicture = (Bitmap) data.getExtras().get(
int width = mPicture.getWidth();
int height = mPicture.getHeight();
int newWidth = 500;
int newHeight = 80;
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
Matrix matrix =
new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
Bitmap resizedBitmap = Bitmap.createBitmap(mPicture, 0, 0, width,
height, matrix,

// save image to gallery

MediaStore.Images.Media.insertImage(getContentResolver(), resizedBitmap, timestamp, timestamp);



Haya is offline  
Last edited by Haya; March 8th, 2010 at 03:04 PM.
Reply With Quote
sponsored links
Old February 4th, 2012, 11:22 PM   #2 (permalink)
New Member
Join Date: Feb 2012
Posts: 3
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts

Hi Haya,, did you get the solution for this question,I am also facing same issue

Image quality decrease after saving to server
mayakannan is offline  
Reply With Quote

Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 06:57 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.