Bitmap.createBitmap几个参数的理解、
来源:互联网 发布:mac os 10.11还是10.9 编辑:程序博客网 时间:2024/05/22 04:36
在bitmap上以X,Y坐标(左上角)为起点,而宽与高则是width与height(右下角 )开始截图
Bitmap viewBitmap=bitmap.createBitmap(bitmap,x,y,width,height);
注意:必须x+width要小于或等于bitmap.getWidth(),y+height要小于或等于bitmap.getHeight()
同理:Bitmap 通过matrix 矩阵变换生成新的Bitmap 以下两个缩放的例子
BitmapmatrixBitmap=bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),bitmap.getHeight(),
matrix, true);
//缩放的方式一 private void testScale1() { Matrix matrix = new Matrix(); matrix.setScale(0.5f, 0.5f); mImageView.setImageMatrix(matrix); } //缩放的方式二 private void testScale2(Bitmap bitmap) { Matrix matrix = new Matrix(); int width =bitmap.getWidth(); int height = bitmap.getHeight(); matrix.setScale(0.5f, 0.5f); mNewBitmap=Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, false); mImageView.setImageBitmap(mNewBitmap); }
基于坐标(px,py)进行按照(sx,sy)比例进行放缩 postScale(float sx, float sy, float px, float py)
matrix.postScale(1.5f, 1.5f,viewWidth / 2, viewHeight/2); 1 0
- Bitmap.createBitmap几个参数的理解、
- Bitmap.createBitmap那个最长参数的方法
- Bitmap.createBitmap那个最长参数的方法
- Bitmap createBitmap参数(一)
- Bitmap createBitmap参数(二)
- Bitmap createBitmap参数(三)
- bitmap的createBitmap
- Bitmap android.graphics.Bitmap.createBitmap(int width, int height, Config config) Config参数的说明
- Bitmap android.graphics.Bitmap.createBitmap(int width, int height, Config config) Config参数的说明
- Bitmap.createBitmap
- Bitmap.createBitmap 得到 的bitmap 不一定是新的bitmap
- 使用Bitmap.createBitmap遇到的问题
- Bitmap.createBitmap的6个重载方法
- 使用Bitmap createBitmap遇到的问题
- Bitmap android.graphics.Bitmap.createBitmap(int width, int height, Config config)张第三个参数的含义
- Bitmap.createBitmap函数用法
- Bitmap.createBitmap学习笔记
- Bitmap.createBitmap创建的新bitmap可能与原始bitmap是一个对象
- T-SQL学习之路之数据库完整性之默认值
- Character Controller深度解析
- C++设计模式[三]建造者模式
- 贪心算法
- 理解FCM聚类算法中拉格朗日乘子法(Lagrange Multiplier) 和KKT条件
- Bitmap.createBitmap几个参数的理解、
- IP地址分类与子网划分
- 数组
- 有漏洞的代码
- 欢迎使用CSDN-markdown编辑器
- 自己动手丰衣足食之完数_黑马程序员
- 把毫秒ms换算成xx:xx:xx形式
- html DOM 实践(1)
- 蓝懿ios 技术内容和心得交流分享 11.3 打飞机主要步骤