@@ -48,10 +48,13 @@ base64Driver := driver.DefaultDriverDigit
48
48
49
49
// 使用自定义配置
50
50
base64Driver := driver.NewDriverDigit(driver.DriverDigit{
51
- Width: 240, // 宽度
52
- Height: 60, // 高度
53
- Length: 6, // 长度
54
- NoiseCount: 2, // 点数量
51
+ Width: 240, // 宽度
52
+ Height: 60, // 高度
53
+ Length: 6, // 长度
54
+ NoiseCount: 2, // 点数量
55
+ Source: " 0123456789 " ,
56
+ Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
57
+ BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
55
58
})
56
59
```
57
60
@@ -65,13 +68,13 @@ base64Driver := driver.DefaultDriverLetter
65
68
66
69
// 使用自定义配置
67
70
base64Driver := driver.NewDriverLetter(driver.DriverLetter{
68
- Width: 240, // 宽度
69
- Height: 60, // 高度
70
- Length: 6, // 长度
71
- NoiseCount: 2, // 点数量
72
- Source: " ABCDEFGHJKMNOQRSTUVXYZabcdefghjkmnoqrstuvxyz" ,
73
- Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
74
- BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
71
+ Width: 240, // 宽度
72
+ Height: 60, // 高度
73
+ Length: 6, // 长度
74
+ NoiseCount: 2, // 点数量
75
+ Source: " ABCDEFGHJKMNOQRSTUVXYZabcdefghjkmnoqrstuvxyz" ,
76
+ Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
77
+ BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
75
78
})
76
79
```
77
80
@@ -85,12 +88,12 @@ base64Driver := driver.DefaultDriverMath
85
88
86
89
// 使用自定义配置
87
90
base64Driver := driver.NewDriverMath(driver.DriverMath{
88
- Width: 240, // 宽度
89
- Height: 60, // 高度
90
- NoiseCount: 2, // 点数量
91
- ShowLineOptions: 0, // 显示线条
92
- Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
93
- BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
91
+ Width: 240, // 宽度
92
+ Height: 60, // 高度
93
+ NoiseCount: 2, // 点数量
94
+ ShowLineOptions: 0, // 显示线条
95
+ Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
96
+ BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
94
97
})
95
98
```
96
99
@@ -104,14 +107,14 @@ base64Driver := driver.DefaultDriverString
104
107
105
108
// 使用自定义配置
106
109
base64Driver := driver.NewDriverString(driver.DriverString{
107
- Width: 240, // 宽度
108
- Height: 60, // 高度
109
- Length: 6, // 长度
110
- NoiseCount: 2, // 点数量
111
- ShowLineOptions: 0, // 显示线条
112
- Source: " ABCDEFGHJKMNOQRSTUVXYZabcdefghjkmnoqrstuvxyz" , // 字符源
113
- Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
114
- BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
110
+ Width: 240, // 宽度
111
+ Height: 60, // 高度
112
+ Length: 6, // 长度
113
+ NoiseCount: 2, // 点数量
114
+ ShowLineOptions: 0, // 显示线条
115
+ Source: " ABCDEFGHJKMNOQRSTUVXYZabcdefghjkmnoqrstuvxyz" , // 字符源
116
+ Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
117
+ BgColor: &color.RGBA{R: 0, G: 0, B: 0, A: 0}, // 背景颜色
115
118
})
116
119
```
117
120
@@ -125,14 +128,14 @@ base64Driver := driver.DefaultDriverChinese
125
128
126
129
// 使用自定义配置
127
130
base64Driver := driver.NewDriverChinese(driver.DriverChinese{
128
- Width: 240, // 宽度
129
- Height: 60, // 高度
130
- Length: 6, // 长度
131
- NoiseCount: 2, // 点数量
132
- ShowLineOptions: 0, // 显示线条
133
- Source: " 设想,你在,处理,消费者,的音,频输,出音,频可,能无,论什,么都,没有,任何,输出,或者,它可,能是,单声道,立体声,或是,环绕立,体声的,,不想要,的值" , // 字符源
134
- Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
135
- BgColor: &color.RGBA{R: 125, G: 125, B: 0, A: 118}, // 背景颜色
131
+ Width: 240, // 宽度
132
+ Height: 60, // 高度
133
+ Length: 6, // 长度
134
+ NoiseCount: 2, // 点数量
135
+ ShowLineOptions: 0, // 显示线条
136
+ Source: " 设想,你在,处理,消费者,的音,频输,出音,频可,能无,论什,么都,没有,任何,输出,或者,它可,能是,单声道,立体声,或是,环绕立,体声的,,不想要,的值" , // 字符源
137
+ Fonts: []string{" wqy-microhei.ttc " }, // 显示字体
138
+ BgColor: &color.RGBA{R: 125, G: 125, B: 0, A: 118}, // 背景颜色
136
139
})
137
140
```
138
141
@@ -146,8 +149,8 @@ base64Driver := driver.DefaultDriverAudio
146
149
147
150
// 使用自定义配置
148
151
base64Driver := driver.NewDriverAudio(driver.DriverAudio{
149
- Length: 6, // 长度
150
- Language: " en" , // 语言,目前支持:en、zh、ja、ru、de
152
+ Length: 6, // 长度
153
+ Language: " en" , // 语言,目前支持:en、zh、ja、ru、de
151
154
})
152
155
```
153
156
0 commit comments