|
|
|
@ -114,7 +114,12 @@ public class ImageUtils {
|
|
|
|
|
public static void drawDashedRectangleOnImages(String imagePath, List<List<Point>> pointList, String outputPath) {
|
|
|
|
|
try {
|
|
|
|
|
// Load the image
|
|
|
|
|
BufferedImage image = ImageIO.read(new URL(imagePath));
|
|
|
|
|
BufferedImage image = null;
|
|
|
|
|
if (imagePath.contains("http:") ||imagePath.contains("https:")) {
|
|
|
|
|
image = ImageIO.read(new URL(imagePath));
|
|
|
|
|
}else{
|
|
|
|
|
image = ImageIO.read(new File(imagePath));
|
|
|
|
|
}
|
|
|
|
|
for (List<Point> points : pointList) {
|
|
|
|
|
Graphics2D g2d = image.createGraphics();
|
|
|
|
|
// 设置线的颜色
|
|
|
|
|