<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] # 1. 前言 Matrix是Android提供的一個矩陣工具類,可以結合其余API來進行控制圖像、組件的變換。使用Matrix可以很輕松的完成平移、縮放、旋轉、傾斜功能。使用步驟如下: * 得到Matrix對象; * 調用平移、翻轉、縮放、傾斜等方法; * 應用到指定的圖形或者控件; ## 1.1 對應方法 ### 1.1.1 平移 ~~~java // dx,dy為平移距離 void setTranslate(float dx, float dy); ~~~ ### 1.1.2 傾斜 ~~~java // kx,ky為傾斜距離 void setSkew(float kx, float ky); // px,py為軸心 void setSkew(float kx, float ky, float px, float py); ~~~ ### 1.1.3 旋轉 ~~~java // 角度 void setRotate(float degrees); // px,py為軸心 void setRotate(float degrees, float px, float py); ~~~ ### 1.1.4 縮放 ~~~java // 縮放比例 void setScale(float sx, float sy); // px,py為軸心 void setScale(float sx, float sy, float px, float py); ~~~ ## 1.2 應用 這里以縮放為例: ~~~ // 得到資源文件的Bitmap對象 mContentBitmap = BitmapFactory.decodeResource(resources, R.drawable.b) // 應用matrix變換 myMatrix= Matrix() val scale = 300f / mContentBitmap.width // 縮放倍率,圓形坐標 myMatrix.setScale(scale, scale, 200f, 200f) // 根據原始圖片和Matrix創建新的圖片 tempBitmap = Bitmap.createBitmap(mContentBitmap, 0, 0, mContentBitmap.width, mContentBitmap.height, myMatrix, true) ~~~ 然后在onDraw函數中進行繪制顯示: ~~~ // 繪制新的圖片 canvas?.drawBitmap(tempBitmap, myMatrix, mPaint) ~~~
                  <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>

                              哎呀哎呀视频在线观看