mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
de6eb1deea
commit
6b95a60c4b
@ -74,6 +74,11 @@ public class QrConfig {
|
||||
* 二维码中的Logo
|
||||
*/
|
||||
protected Image img;
|
||||
|
||||
/**
|
||||
* 二维码logo圆角弧度,0~1,为长宽占比
|
||||
*/
|
||||
protected double imgRound = 0.3;
|
||||
/**
|
||||
* 二维码中的Logo缩放的比例系数,如5表示长宽最小值的1/5
|
||||
*/
|
||||
@ -385,6 +390,26 @@ public class QrConfig {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取二维码logo圆角弧度,0~1,为长宽占比
|
||||
* @return 二维码logo圆角弧度,0~1,为长宽占比
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public double getImgRound() {
|
||||
return imgRound;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置二维码logo圆角弧度,0~1,为长宽占比
|
||||
* @param imgRound 二维码logo圆角弧度,0~1,为长宽占比
|
||||
* @return this
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public QrConfig setImgRound(final double imgRound) {
|
||||
this.imgRound = imgRound;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取二维码中的Logo缩放的比例系数,如5表示长宽最小值的1/5
|
||||
*
|
||||
|
@ -87,7 +87,7 @@ public class QrImage extends BufferedImage {
|
||||
}
|
||||
|
||||
Img.from(this).pressImage(//
|
||||
Img.from(logoImg).round(0.3).getImg(), // 圆角
|
||||
Img.from(logoImg).round(config.imgRound).getImg(), // 圆角
|
||||
new Rectangle(imgWidth, imgHeight), // 位置
|
||||
1//不透明
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user