All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.minsin.qrcode.model.LogoModel Maven / Gradle / Ivy

Go to download

mutils组件中,提供二维码一键生成的模块。此模块可单独引用。 maven仓库:https://mvnrepository.com/artifact/cn.minsin/mutils-qrcode

There is a newer version: 0.4.0.RELEASE
Show newest version
package cn.minsin.qrcode.model;

import cn.minsin.core.annotation.NotNull;
import cn.minsin.core.rule.AbstractModelRule;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

import java.awt.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

@Getter
@Setter
public class LogoModel extends AbstractModelRule {

    /**
     *
     */
    private static final long serialVersionUID = -4459664046168353683L;

    @NotNull("log宽度 不能大于二维码宽度的1/5 否则会无法识别")
    private Integer width = 100;

    @NotNull("高度 不能大于二维码高度的1/5 否则会无法识别")
    private Integer height = 100;

    @NotNull("logo文件")
    @Setter(AccessLevel.NONE)
    private InputStream logo;

    @NotNull("logo边框颜色 默认白色")
    private Color borderColor = Color.WHITE;

    @NotNull("是否弧形 默认 true")
    private Boolean isArc = true;


    public void setLogo(File file) throws FileNotFoundException {
        this.logo = new FileInputStream(file);
    }

    public void setLogo(FileInputStream fileInputStream) {
        this.logo = fileInputStream;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy