<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Bitmap局部解碼 [官網文檔-BitmapRegionDecoder](https://developer.android.com/reference/android/graphics/BitmapRegionDecoder?hl=en) ,`BitmapRegionDecoder` 可用于解碼圖像中的矩形區域。當原始圖像很大且只需要部分圖像時,`BitmapRegionDecoder` 尤其有用。 要創建 `BitmapRegionDecoder`,請調用 `newInstance()` 。給定一個 `BitmapRegionDecoder`,用戶可以重復調用 `encodeRegio()`以獲取指定區域的解碼后的 `Bitmap` 。 ```java try { inputStream = getResources().getAssets().open("qq.jpg"); BitmapRegionDecoder mRegionDecoder = BitmapRegionDecoder.newInstance(inputStream, false); BitmapFactory.Options sOptions = new BitmapFactory.Options(); sOptions.inPreferredConfig = Bitmap.Config.ARGB_8888; sOptions.inSampleSize = 2; Rect mRect = new Rect(); mRect.top = 0; mRect.left = 0; mRect.right = 100; mRect.bottom = 100; Bitmap bitmap = mRegionDecoder.decodeRegion(mRect, sOptions); //bitmap.getByteCount()=40000 } catch (IOException e) { e.printStackTrace(); } ``` 這里需要注意的是 `mRect` 的寬高不能太大,否則加載得到的 `Bitmap` 的時候也會出現 `OOM` 的異常。 ***** 文章到這里就全部講述完啦,若有其他需要交流的可以留言哦~!~! 想閱讀作者的更多文章,可以查看我 [個人博客](http://dandanlove.com/) 和公共號:![振興書城](https://imgconvert.csdnimg.cn/aHR0cDovL3VwbG9hZC1pbWFnZXMuamlhbnNodS5pby91cGxvYWRfaW1hZ2VzLzEzMTk4NzktNjEyYzRjNjZkNDBjZTg1NS5qcGc?x-oss-process=image/format,png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看