¡@

Home 

2014/10/16 ¤W¤È 08:14:10

android Programming Glossary: getimageuri

How to capture the image and save it in sd card

http://stackoverflow.com/questions/5661424/how-to-capture-the-image-and-save-it-in-sd-card

app to take a photo Intent intent new Intent MediaStore.ACTION_IMAGE_CAPTURE intent.putExtra MediaStore.EXTRA_OUTPUT getImageUri startActivityForResult intent TAKE_PHOTO_CODE @Override protected void onActivityResult int requestCode int resultCode.. super.onActivityResult requestCode resultCode data if requestCode TAKE_PHOTO_CODE resultCode RESULT_OK Uri imagePath getImageUri doSomething Get the uri of the captured file @return A Uri which path is the path of an image file stored on the dcim folder.. uri of the captured file @return A Uri which path is the path of an image file stored on the dcim folder private Uri getImageUri Store image in dcim File file new File Environment.getExternalStorageDirectory DCIM CAPTURE_TITLE Uri imgUri Uri.fromFile..

How to crop image in android

http://stackoverflow.com/questions/6464123/how-to-crop-image-in-android

circleCrop null mCircleCrop true mAspectX 1 mAspectY 1 mImagePath extras.getString image path mSaveUri getImageUri mImagePath mBitmap getBitmap mImagePath mAspectX extras.getInt aspectX mAspectY extras.getInt aspectY mOutputX extras.getInt.. .setOnClickListener new View.OnClickListener public void onClick View v onSaveClicked startFaceDetection private Uri getImageUri String path return Uri.fromFile new File path private Bitmap getBitmap String path Uri uri getImageUri path InputStream.. private Uri getImageUri String path return Uri.fromFile new File path private Bitmap getBitmap String path Uri uri getImageUri path InputStream in null try in mContentResolver.openInputStream uri return BitmapFactory.decodeStream in catch FileNotFoundException..