Git Product home page Git Product logo

androidcomponetdemo's Introduction

快速入门

1.新建一个水印文字图片,压缩照片质量到90k

val waterStr = "**始终支持多边主义、践行多边主义,以开放、合作、共赢精神同世界各国共谋发展" // 水印文字
val waterPosition = WaterMarkPosition.BOTTOM // 水印位置(TOP:上方,左对齐 CENTER:居中,左对齐 BOTTOM:下方,左对齐)
val filePath = ".../com.aotuman.watermak/img.jpg" // 文件保存路径
val needCompress = true  // 是否压缩图片质量
val saveFileLength = 90  // 压缩图片质量到指定大小(单位:kb)
val targetWidth = 600 // 目标照片宽度
val targetHeight = 840 // 目标照片高度
val targetView = imageView // 照片显示对应的imageView
WaterMark.Builder()
    .setWaterMarkText(waterStr)
    .setWaterMarkPosition(waterPosition)
    .setSaveFilePath(filePath) 
    .setSaveFileSize(saveFileLength)
    .setNeedCompress(needCompress)
    .setTargetWidth(targetWidth)
    .setTargetHeight(targetHeight)
    .setTargetView(targetView)
    .build()

2.效果展示

img

androidcomponetdemo's People

Contributors

michael19900101 avatar

Watchers

James Cloos avatar  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.