zoukankan      html  css  js  c++  java
  • //--合并两张图片 BITMAP

    private Bitmap toConformBitmap(Bitmap background, Bitmap foreground) {
    //--合并两张图片
    if( background == null ) {
    return null;
    }
    int bgWidth = background.getWidth();
    int bgHeight = background.getHeight();
    //int fgWidth = foreground.getWidth();
    //int fgHeight = foreground.getHeight();
    //create the new blank bitmap 创建一个新的和SRC长度宽度一样的位图
    Bitmap newbmp = Bitmap.createBitmap(bgWidth, bgHeight, Bitmap.Config.ARGB_8888);
    Canvas cv = new Canvas(newbmp);
    //draw bg into
    cv.drawBitmap(background, 0, 0, null);//在 0,0坐标开始画入bg
    //draw fg into
    cv.drawBitmap(foreground, 0, 0, null);//在 0,0坐标开始画入fg ,可以从任意位置画入
    //save all clip
    cv.save(Canvas.ALL_SAVE_FLAG);//保存
    //store
    cv.restore();//存储
    return newbmp;
    }
  • 相关阅读:
    三级菜单
    包的初识和进阶&异常处理
    常用模块一
    flask-script
    DBUtils
    Flask-WTForms
    Flask-SQLAchemy
    Flask
    scrapy-redis的使用和解析
    Django的信号;flask的信号;scrapy的信号;
  • 原文地址:https://www.cnblogs.com/hui413027075/p/6924504.html
Copyright © 2011-2022 走看看