最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

如何使用Matrix對(duì)bitmap的旋轉(zhuǎn)與鏡像水平垂直翻轉(zhuǎn)

 更新時(shí)間:2013年06月15日 11:47:52   作者:  
本篇文章是對(duì)使用Matrix對(duì)bitmap的旋轉(zhuǎn)與鏡像水平垂直翻轉(zhuǎn)進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
Bitmap convert(Bitmap a, int width, int height)
{
int w = a.getWidth();
int h = a.getHeight();
Bitmap newb = Bitmap.createBitmap(ww, wh, Config.ARGB_8888);// 創(chuàng)建一個(gè)新的和SRC長度寬度一樣的位圖
Canvas cv = new Canvas(newb);
Matrix m = new Matrix();
m.postScale(1, -1);   //鏡像垂直翻轉(zhuǎn)
m.postScale(-1, 1);   //鏡像水平翻轉(zhuǎn)
m.postRotate(-90);  //旋轉(zhuǎn)-90度
Bitmap new2 = Bitmap.createBitmap(a, 0, 0, w, h, m, true);
cv.drawBitmap(new2, new Rect(0, 0, new2.getWidth(), new2.getHeight()),new Rect(0, 0, ww, wh), null);
return newb;
}

相關(guān)文章

最新評(píng)論

大港区| 农安县| 子洲县| 和顺县| 高淳县| 慈溪市| 清远市| 新河县| 独山县| 高阳县| 五峰| 平顶山市| 滨海县| 北流市| 长春市| 上高县| 公安县| 沅陵县| 永安市| 和顺县| 韩城市| 洞头县| 濉溪县| 青铜峡市| 河间市| 绿春县| 江油市| 天台县| 奈曼旗| 凤凰县| 波密县| 清水河县| 富锦市| 新丰县| 营山县| 城步| 深州市| 塘沽区| 屯昌县| 如皋市| 康平县|