Giter Club home page Giter Club logo

data-tool's Introduction

数据处理工具

图片工具使用

海报制作

// 模板图片
File srcFile = new File("E:\\image2020-1-17_17-53-21.png");
// 头像
BufferedImage portraitImage = ImageIO.read(new File("E:\\DSC_0183.JPG"));
// 二维码
BufferedImage srImg = ImageIO.read(new File("E:\\sr.jpg"));

// 参数1=模板图片;参数2=最终制作的图片的输出位置
DefaultPosterDrawer drawer = new DefaultPosterDrawer(srcFile, "E:\\result.png");
Color c = new Color(100, 100, 100);
Font f = new Font("微软雅黑", Font.PLAIN, 25);

int hSpace = 50;
int x = 120;
int y = 450;
drawer
	// 写文字到图片上
    .writeText("xxxxxxxxxx", x, y += hSpace, c, f)
    .writeText("xxxxxxxxxx", x, y += hSpace, c, f)
    .writeText("xxxx", x, y += hSpace, c, f)
    .writeText("xxxx", x, y += hSpace, c, f)
    // 头像
    // 画个圆图到图片上,如果传的图片是方的,会切成圆形
    .drawCircleImage(portraitImage, 205, 120, 86)
    // 画个图片到图片上
    .dramImage(srImg, 79, 800, 131, 131)
    .dramImage(srImg, 172, 268, 200, 40)
    .writeText("武汉加油", 172, 323, Color.RED, f)// 调用这个方法会输出图片
    // 调用这个方法会输出图片
    .make();

data-tool's People

Contributors

songkv5 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.