We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73a1fd4 commit eda7816Copy full SHA for eda7816
src/org/nutz/img/Images.java
@@ -1439,7 +1439,7 @@ public static BufferedImage createCaptcha(String content,
1439
1440
// 写入文字
1441
int rx = 10;
1442
- int ry = isChinese ? 22 : 20;
+ int ry = isChinese ? height - 8 : height - 10;
1443
for (int i = 0; i < content.length(); i++) {
1444
int fontStyle = R.random(0, 3);
1445
int fontSize = R.random(height - 10, height - 5);
@@ -1454,7 +1454,7 @@ public static BufferedImage createCaptcha(String content,
1454
gc.drawString(content.charAt(i) + "", rx, ry);
1455
// 反向角度
1456
gc.rotate(-degree * Math.PI / 180, rx, ry);
1457
- rx += isChinese ? 25 : 20;
+ rx += (isChinese ? 5 : 0) + width / (content.length() + 2);
1458
}
1459
1460
// 图像扭曲
0 commit comments