<code id="ymukc"><xmp id="ymukc">

Andorid Bitmap 重采樣

OPEN編輯的頭像 OPEN編輯 1 2016-05-05 18:13 2

 基本信息

× 1    × 1   

瀏覽數: 31777

分享時間: 2 年 前

4
    public Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) {
        int width = bm.getWidth();
        int height = bm.getHeight();
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;
        // CREATE A MATRIX FOR THE MANIPULATION
        Matrix matrix = new Matrix();
        // RESIZE THE BIT MAP
        matrix.postScale(scaleWidth, scaleHeight);

        // "RECREATE" THE NEW BITMAP
        Bitmap resizedBitmap = Bitmap.createBitmap(
                bm, 0, 0, width, height, matrix, false);
        bm.recycle();
        return resizedBitmap;
    }

 

不錯不錯
1 年 前 20151313

12 3 [下一頁]

  • williams26的頭像 williams26 2016-12-23 16:22 代碼數:0

    好的。謝謝

  • 2689548458的頭像 2689548458 2017-11-20 21:30 代碼數:0

    贊一個

  • 威茲曼的頭像 威茲曼 2016-05-25 12:32 代碼數:0

  • annashetty的頭像 annashetty 2018-01-22 11:55 代碼數:0

    不錯不錯 play cool math games

  • aq2130062的頭像 aq2130062 2018-02-05 18:21 代碼數:0

    好好的講解阿!

  • AsharSeo的頭像 AsharSeo 2018-09-18 01:28 代碼數:0

    Aw, i thought this was quite a nice post. In concept I must set up writing like this additionally – spending time and actual effort to make a great article… but exactly what do I say… I procrastinate alot through no means appear to go carried out.

    Amos

  • psncore的頭像 psncore 2018-07-15 03:42 代碼數:0

    `vey nice too see this i love it better is not possible even now i need to translate everything psn code generator

  • banjue的頭像 banjue 2017-04-28 16:46 代碼數:0

    學到了

  • Nissan的頭像 Nissan 2018-10-01 16:46 代碼數:0

     

     Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place.  Honda Odyssey colors

  • trangctp的頭像 trangctp 2018-08-16 09:55 代碼數:0

    I like to get up early to go out and breathe fresh air. I feel that it is good for health and a good habit 

    Return Man 3

您的評論:

  
六合特码资料
<code id="ymukc"><xmp id="ymukc">
<code id="ymukc"><xmp id="ymukc">