mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix comment
This commit is contained in:
parent
d1472f2bfe
commit
3fd1ebe0f5
@ -40,7 +40,7 @@ public class QrCodeUtil {
|
||||
|
||||
public static final String QR_TYPE_SVG = "svg";// SVG矢量图格式
|
||||
public static final String QR_TYPE_TXT = "txt";// Ascii Art字符画文本
|
||||
private static final AnsiColors ansiColors= new AnsiColors(AnsiColors.BitDepth.EIGHT);
|
||||
private static final AnsiColors ansiColors = new AnsiColors(AnsiColors.BitDepth.EIGHT);
|
||||
|
||||
/**
|
||||
* 生成代 logo 图片的 Base64 编码格式的二维码,以 String 形式表示
|
||||
@ -162,6 +162,7 @@ public class QrCodeUtil {
|
||||
* @param content 内容
|
||||
* @param width 宽度(单位:字符▄的大小)
|
||||
* @param height 高度(单位:字符▄的大小)
|
||||
* @param margin 边距大小(1~4)
|
||||
* @return ASCII Art字符画形式的二维码
|
||||
* @since 5.8.6
|
||||
*/
|
||||
@ -563,6 +564,7 @@ public class QrCodeUtil {
|
||||
* @param matrix BitMatrix
|
||||
* @param foreColor 前景色
|
||||
* @param backColor 背景色(null表示透明背景)
|
||||
* @param logoImg LOGO图片
|
||||
* @param ratio 二维码中的Logo缩放的比例系数,如5表示长宽最小值的1/5
|
||||
* @return SVG矢量图(字符串)
|
||||
* @since 5.8.6
|
||||
@ -610,7 +612,7 @@ public class QrCodeUtil {
|
||||
result.append("xmlns=\"http://www.w3.org/2000/svg\" \n");
|
||||
result.append("xmlns:xlink=\"http://www.w3.org/1999/xlink\" >\n");
|
||||
result.append("<path d=\"").append(sb).append("\" ");
|
||||
if (foreColor!=null){
|
||||
if (foreColor != null) {
|
||||
Color fore = new Color(foreColor, true);
|
||||
result.append("stroke=\"rgba(").append(fore.getRed()).append(",").append(fore.getGreen()).append(",").append(fore.getBlue()).append(",").append(fore.getAlpha()).append(")\"");
|
||||
}
|
||||
@ -626,6 +628,7 @@ public class QrCodeUtil {
|
||||
* BitMatrix转ASCII Art字符画形式的二维码
|
||||
*
|
||||
* @param bitMatrix BitMatrix
|
||||
* @param qrConfig QR设置
|
||||
* @return ASCII Art字符画形式的二维码
|
||||
* @since 5.8.6
|
||||
*/
|
||||
@ -658,7 +661,9 @@ public class QrCodeUtil {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/* *//**
|
||||
/* */
|
||||
|
||||
/**
|
||||
* rgb转AnsiElement
|
||||
*
|
||||
* @param rgb rgb颜色值
|
||||
@ -666,7 +671,7 @@ public class QrCodeUtil {
|
||||
* @return AnsiElement
|
||||
* @since 5.8.6
|
||||
*/
|
||||
private static AnsiElement rgbToAnsi8BitElement(int rgb,ForeOrBack foreOrBack) {
|
||||
private static AnsiElement rgbToAnsi8BitElement(int rgb, ForeOrBack foreOrBack) {
|
||||
return ansiColors.findClosest(new Color(rgb)).toAnsiElement(foreOrBack);
|
||||
}
|
||||
|
||||
|
@ -28,15 +28,15 @@ public class QrConfig {
|
||||
|
||||
/**
|
||||
* 宽度(单位:像素或▄)
|
||||
* <div>当二维码类型为一般图片或者SVG时,单位是像素<div/>
|
||||
* <div>当二维码类型Ascii Art字符画时,单位是字符▄或▀的大小<div/>
|
||||
* <p>当二维码类型为一般图片或者SVG时,单位是像素</p>
|
||||
* <p>当二维码类型Ascii Art字符画时,单位是字符▄或▀的大小</p>
|
||||
*/
|
||||
protected int width;
|
||||
|
||||
/**
|
||||
* 高度(单位:像素或▄)
|
||||
* <div>当二维码类型为一般图片或者SVG时,单位是像素<div/>
|
||||
* <div>当二维码类型Ascii Art字符画时,单位是字符▄或▀的大小<div/>
|
||||
* <p>当二维码类型为一般图片或者SVG时,单位是像素</p>
|
||||
* <p>当二维码类型Ascii Art字符画时,单位是字符▄或▀的大小</p>
|
||||
*/
|
||||
protected int height;
|
||||
/** 前景色(二维码颜色) */
|
||||
|
Loading…
x
Reference in New Issue
Block a user