欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

如何使用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長(zhǎng)度寬度一樣的位圖
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)論