【add】添加验证码前的干扰线

This commit is contained in:
mzc5649
2021-04-15 12:37:43 +08:00
parent 80d27e853f
commit 2f846ba8c4
@@ -117,6 +117,10 @@ public class RandImageUtil {
// 设置字符,字符间距,上边距
graphics.drawString(String.valueOf(resultCode.charAt(i)), (23 * i) + 8, 26);
}
for(int i = 0; i < 4; i++){
graphics.setColor(getRandColor(0, 256));
graphics.drawLine(0, random.nextInt(height), width, random.nextInt(height));
}
// 图象生效
graphics.dispose();
return image;