mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-03 16:24:31 +08:00
commit
cf7f57e66d
@ -380,7 +380,7 @@ public class QrCodeUtil {
|
||||
}
|
||||
|
||||
Img.from(image).pressImage(//
|
||||
Img.from(logoImg).round(0.3).getImg(), // 圆角
|
||||
Img.from(logoImg).round(config.round).getImg(), // 圆角
|
||||
new Rectangle(width, height), //
|
||||
1//
|
||||
);
|
||||
|
@ -53,6 +53,8 @@ public class QrConfig {
|
||||
protected Charset charset = CharsetUtil.CHARSET_UTF_8;
|
||||
/** 二维码中的Logo */
|
||||
protected Image img;
|
||||
/** 二维码中的Logo圆角弧度 */
|
||||
protected double round = 0.3;
|
||||
/** 二维码中的Logo缩放的比例系数,如5表示长宽最小值的1/5 */
|
||||
protected int ratio = 6;
|
||||
/**
|
||||
@ -343,6 +345,26 @@ public class QrConfig {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取二维码中的Logo圆角弧度
|
||||
*
|
||||
* @return 二维码中的Logo圆角弧度
|
||||
*/
|
||||
public double getRound() {
|
||||
return round;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置二维码中的Logo圆角弧度
|
||||
*
|
||||
* @param round 二维码中的Logo圆角弧度
|
||||
* @return this;
|
||||
*/
|
||||
public QrConfig setRound(double round) {
|
||||
this.round = round;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置DATA_MATRIX的符号形状
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user