Android study note _ 66 _ image processing topic

Source: Internet
Author: User

1. Image Scaling: the entire image information is not parsed.

  DemoActivity  = (ImageView)                          Display currentDisplay = dw = dh =        BitmapFactory.Options bmpFactoryOptions =         bmpFactoryOptions.inJustDecodeBounds =         Bitmap bmp = BitmapFactory.decodeFile("/sdcard/img.jpg"         heightRatio = ()Math.ceil(bmpFactoryOptions.outHeight/( widthRatio = ()Math.ceil(bmpFactoryOptions.outWidth/("HEIGHTRATIO",""+"WIDTHRATIO",""+        bmpFactoryOptions.inJustDecodeBounds = (heightRatio>=== BitmapFactory.decodeFile("/sdcard/img.jpg"

2. ExifInterface:

DemoActivity = ExifInterface ("sdcard/img.jpg" "camera", "Kodak camera" "camera"

3. Select an image from the image library and set it to ImageView.

  DemoActivity  = (ImageView)          Intent intent = "image/*"0  onActivityResult( requestCode, (data!=            Uri uri =

4. Create a copy of an image (bitmap:

  DemoActivity  = (ImageView) = (ImageView)  = "image/*"0  onActivityResult( requestCode, (data!=            Uri uri =                            Bitmap bitmap =                Matrix matrix =                 Paint paint = );                matrix.setRotate(15);                Bitmap    alteredBitmap = Bitmap.createBitmap(bitmap, 0, 0                Canvas canvas = 

5. image synthesis:

  DemoActivity  = (ImageView)  = "image/*"10 =  File("/sdcard/1.jpg"= 100            Intent intent =  Intent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://"+ = "image/*"20  onActivityResult( requestCode, (requestCode==10(data!===== = 0, 0 (requestCode==20(data!==                =0,0

6. Draw text based on Path:

  DemoActivity   MyView(  MyView  = 20= 20, 20100, 150200, 220"Hello this is text on a path", p, 0, 0

7. Drawing (move your finger to create an image and save it ):

  DemoActivity  = (ImageView) = height = diaplay.getHeight() - 40 width === = 10 startx = 0 starty = 0 == x = y === endx = endy =  =  File("/sdcard/"+System.currentTimeMillis()+".jpg"= 100            Intent intent =  Intent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://"+

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.