Giter Club home page Giter Club logo

watermarkbg's Introduction

页面水印 类:WaterMarkPageBg

最近公司发布保护个人隐私,内部公共信息不能外传的命令,因此做了一个水印的功能,分为页面水印以及图片水印两种
1.页面水印
页面水印封装代码在WaterMarkPageBg类里面:
调用方法为:
//当前日期
SimpleDateFormat createTimeSdf1 = new SimpleDateFormat("yyyy-MM-dd");
//创建一个多行显示list
final List labels = new ArrayList<>();
labels.add("用户名:绿帽三");
labels.add("日期:"+ createTimeSdf1.format(new Date()));
labels.add("私人非开放信息页面");
//页面背景增加水印案例(可扩增可控属性,水印字体颜色,背景字体颜色等)
findViewById(R.id.bg).setBackgroundDrawable(new WaterMarkPageBg(MainActivity.this,labels,-30,13));

    放在方法里面或者实例方法里就可使用,属性可扩增。

图片水印 类:WaterMarkPictureBg

2.图片水印
图片水印封装代码在WaterMarkPictureBg类里面:
调用方法为:
//当前日期
SimpleDateFormat createTimeSdf1 = new SimpleDateFormat("yyyy-MM-dd");
//创建一个多行显示list
final List labels = new ArrayList<>();
labels.add("用户名:绿帽三");
labels.add("日期:"+ createTimeSdf1.format(new Date()));
labels.add("私人非开放信息页面");
//图片增加水印案例
WaterMarkPictureBg.merge(MainActivity.this,labels,-30,14,"#000000","/mnt/sdcard/DCIM/TL/FQD","201911.png","/mnt/sdcard/DCIM/TL/FQD","201912.png");

    放在方法里面或者实例方法里就可使用,属性可扩增。

watermarkbg's People

Contributors

chenjingchao1108 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.