1、缩放

	public Bitmap scalingBitmap(Bitmap bitmap, int newW, int newH) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
float sx = (float) newW / w;
float sy = (float) newH / h;
Matrix matrix = new Matrix();
matrix.postScale(sx, sy); // 长和宽放大缩小的比例
return Bitmap.createBitmap(bitmap, 0, 0, w, h, matrix, true);
}

2、代码修改shape颜色

GradientDrawable myGrad = (GradientDrawable) view.getBackground();
myGrad.setColor(Color.parseColor("#4bd1c9"));

  

最新文章

  1. 【jquery】字符ascii码转换函数
  2. HDU5785 Interesting(Manacher + 延迟标记)
  3. Linux_导出函数
  4. hdu 4712 Hamming Distance 随机
  5. 【狼】unity3d iTween插件的学习
  6. 【转】java中equal与==的区别 其中有个缓冲区,需要注意
  7. MyBatis学习日记(三):戏说MyBatis配置文件
  8. PC机Win10声音问题两例处理办法
  9. java程序中默认浮点形值常量是什么类型的?如何区分不同类型的浮点型整数值常量?
  10. 复制数组之System.arraycopy()的使用
  11. Xamarin Essentials教程使用加速度传感器Accelerometer
  12. vue改变了数据却没有自动刷新
  13. C#语言与变量、数据类型
  14. 【转】Oracle virtual column(虚拟列)
  15. Activex控件的IObjectSafety接口问题
  16. [Android 开发教程(1)]-- Saving Data in SQL Databases
  17. SVN安装后bin中没有svn.exe,TortoiseSVN安装后bin目录中没有svn.exe;
  18. bzoj1834: [ZJOI2010]network 网络扩容 费用流
  19. 云数据库Redis版256M双机热备款
  20. video事件

热门文章

  1. Deep Learning 24:读论文“Batch-normalized Maxout Network in Network”——mnist错误率为0.24%
  2. java打印Jni层log
  3. android Glide图片加载框架的初探
  4. autobench 测试笔记
  5. div跟随页面滚动
  6. Right Here Waiting
  7. biweb后台添加上传下载功能
  8. YY前端课1
  9. SAP SE11 网格布局显示
  10. MVC5+EF6 入门完整教程六