Android學習筆記_66_圖片處理專題

來源:互聯網
上載者:User

  1、圖片縮放:不解析整個圖片資訊。

  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擷取或設定圖片的exif資訊:

  DemoActivity  =  ExifInterface("sdcard/img.jpg""camera", "柯達相機""camera"

      3、從圖庫裡面選擇一個圖片,然後將它設定到ImageView。

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

  4、建立圖片(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、圖片合成:

  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、根據路徑Path繪製文字:

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

  7、繪圖(根據手指移動建立圖片並儲存):

  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://"+

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.