Android Resize Image and save device storage -


I am doing a project. I need your help because I do not have much information about image resizing. I want to do 240px * 180px as the size of the pictures taken for I use code like below and thanks for everyone interested in the topic.

Thank you all!

  Public zero lephoto (see view) {intent = new intent ("android.media.action.IMAGE_CAPTURE"); File photo = new file (environment. Gatestile store directory ("," Pic.jpg "); Intent.putExtra (MediaStore.EXTRA_OUTPUT, Uri.fromFile (photo)); ImageUri = Uri.framefile (photo); StartActivityForResult (intent, TAKE_PICTURE); } Secure zero activation (int requestcode, integer result code, intent data) {super.onActivityResult (requestCode, resultCode, data); Switch (requestcode) {case 1: if (resultCode == activity. RESULT_OK) {Ure selected image = image URI; GetContentResolver () Inform (selected image, blank); ImageView imageView = (ImageView) findViewById (R.id.imageView1); ContentResolver cr = getContentResolver (); Bitmap bitmap; {Try bitmap = android.provider.MediaStore.Images.Media .getBitmap (cr, selected image); ImageView.setImageBitmap (bitmap); Toast. Make text (this, selected image .string (), toast. LNNHHLANG). Show (); } Hold (exception e) {toast. Maketext (this, "failed to load", Toast. LNNGHHORT). Show (); Logs. E ("Camera", E. Tosting ()); }}}}  


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -