zoukankan      html  css  js  c++  java
  • 图片旋转缩放--Matrix

    protected Bitmap RoateToFit(Bitmap bmp2, float f) {
            // TODO Auto-generated method stub
            int width=bmp2.getWidth();
            int height=bmp2.getHeight();
            Matrix matrix=new Matrix();//定义了一个画布
            matrix.postRotate(f);
            Bitmap bmResult=Bitmap.createBitmap(bmp2, 0, 0, width, height,matrix,true);
    //从源位图bmp2的指定坐标点(0,0)开始,从中挖取宽高widthheight的一块出来创建新的bitmap对象 并且按照matrix制定的规则进行变换
    //把bmp2投影到matrix矩阵 重新创建一个bitmap return bmResult; } protected Bitmap scaleToFit(Bitmap bmp2, float f) { // TODO Auto-generated method stub int width=bmp2.getWidth(); int height=bmp2.getHeight(); Matrix matrix=new Matrix();//定义了一个画布 matrix.postScale(f,f); Bitmap bmResult=Bitmap.createBitmap(bmp2, 0, 0, width, height,matrix,true); //把bmp2投影到matrix矩阵 重新创建一个bitmap return bmResult; }

    讲义335和351有相关知识点

    下面是百度到的:

  • 相关阅读:
    Oracle和MySQL的对比
    mysql的默认隔离级别
    mysql数据库中锁机制的详细介绍
    什么电影是好电影
    周记 2019.4.8~4.14
    周记 2019.3.25~2019.3.31
    IntelliJ Idea 使用笔记
    笔记
    kafka总结
    Spring boot
  • 原文地址:https://www.cnblogs.com/hishark/p/7510148.html
Copyright © 2011-2022 走看看