国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Android Bitmap 改變大小
Java代碼
  1. /**  
  2.      * Returns a Bitmap representing the thumbnail of the specified Bitmap.  
  3.      * The size of the thumbnail is defined by the dimension  
  4.      * android.R.dimen.launcher_application_icon_size.  
  5.      *  
  6.      * This method is not thread-safe and should be invoked on the UI thread only.  
  7.      *  
  8.      * @param bitmap The bitmap to get a thumbnail of.  
  9.      * @param context The application's context.  
  10.      *  
  11.      * @return A thumbnail for the specified bitmap or the bitmap itself if the  
  12.      *         thumbnail could not be created.  
  13.      */  
  14.     public static Bitmap createBitmapThumbnail(Bitmap bitmap, Context context)   
  15.     {   
  16.          if(FusionField.iconWidth == -1&&(FusionField.screenWidth == 800 && FusionField.screenHeight == 480)){   
  17.                 FusionField.iconWidth = 80;   
  18.                 FusionField.iconHeight = 98;   
  19.                
  20.         }   
  21.         else if (FusionField.iconWidth == -1)   
  22.         {   
  23.                 FusionField.iconWidth = 60;   
  24.                 FusionField.iconHeight = 82;   
  25.         }   
  26.   
  27.         final int bitmapWidth = bitmap.getWidth();   
  28.         final int bitmapHeight = bitmap.getHeight();   
  29.   
  30.         Log.e("dean xiang""" + bitmapWidth + ":" + bitmapHeight);   
  31.         if (FusionField.iconWidth > 0 && FusionField.iconHeight > 0)   
  32.         {   
  33.   
  34.             final Bitmap.Config c = Bitmap.Config.ARGB_8888;   
  35.             final Bitmap thumb = Bitmap   
  36.                     .createBitmap(FusionField.iconWidth, FusionField.iconHeight, c);   
  37.             final Canvas canvas = sCanvas;   
  38.             final Paint paint = sPaint;   
  39.   
  40.             canvas.setBitmap(thumb);   
  41.             paint.setDither(false);   
  42.             paint.setFilterBitmap(true);   
  43.             //          int offsetX = Math.abs(sIconWidth - bitmapWidth) / 2;   
  44.             //          int offsetY = Math.abs(sIconHeight - bitmapHeight) / 2;   
  45.             //             
  46.             //          sBounds.set(offsetX, offsetY, bitmapWidth + offsetX,   
  47.             //                  bitmapHeight + offsetY);   
  48.             //          sOldBounds.set(0, 0, bitmapWidth, bitmapHeight);   
  49.             //          canvas.drawBitmap(bitmap, sOldBounds, sBounds, paint);   
  50.                
  51.             sBounds.set(00, FusionField.iconWidth, FusionField.iconHeight);   
  52.             sOldBounds.set(00, bitmapWidth, bitmapHeight);   
  53.             canvas.drawBitmap(bitmap, sOldBounds, sBounds, paint);   
  54.             return thumb;   
  55.         }   
  56.   
  57.         return bitmap;   
  58.     }  
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Android獲取當(dāng)前手機(jī)設(shè)備信息工具類
Android APIDemos 研讀之二:android.graphics.Camera...
android 美化zxing二維碼掃描框
位圖的創(chuàng)建和使用
Drawable、Bitmap、Canvas和Paint的關(guān)系(供復(fù)習(xí)) - Android開發(fā)進(jìn)階交流 - eoe·Android開發(fā)社區(qū) |安致|最棒Android開發(fā)|安致開發(fā)|最好Andriod社區(qū)|安致開發(fā)者|Android論壇 - Powered by Discuz!
android bitmap傳入canvas 畫的東西看不見
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服