Android 图像处理(类型转换,比例缩放,倒影,圆角)的小例子

Android 图像处理(类型转换,比例缩放,倒影,圆角)的小例子,需要的朋友可以参考一下

1.放大缩小图片

复制代码 代码如下:

public static Bitmap zoomBitmap(Bitmap bitmap,int w,int h){   
        int width = bitmap.getWidth();   
        int height = bitmap.getHeight();   
        Matrix matrix = new Matrix();   
        float scaleWidht = ((float)w / width);   
        float scaleHeight = ((float)h / height);   
        matrix.postScale(scaleWidht, scaleHeight);   
        Bitmap newbmp = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);   
        return newbmp;   
    }

以上就是Android 图像处理(类型转换,比例缩放,倒影,圆角)的小例子的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 移动