mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bugs
This commit is contained in:
@@ -633,7 +633,8 @@ public class Img implements Serializable {
|
||||
} else {
|
||||
point = new Point(rectangle.x, rectangle.y);
|
||||
}
|
||||
GraphicsUtil.drawImg(g, img, point);
|
||||
rectangle.setLocation(point.x, point.y);
|
||||
GraphicsUtil.drawImg(g, img, rectangle);
|
||||
|
||||
g.dispose();
|
||||
return backgroundImg;
|
||||
|
@@ -6,6 +6,7 @@ import org.junit.Test;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
public class ImgTest {
|
||||
|
||||
@@ -46,4 +47,12 @@ public class ImgTest {
|
||||
1f)
|
||||
.write(FileUtil.file("d:/test/test2_result.png"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void pressImgTest(){
|
||||
Img.from(FileUtil.file("d:/test/图片1.JPG"))
|
||||
.pressImage(ImgUtil.read("d:/test/617180969474805871.jpg"), new Rectangle(0, 0, 800, 800), 1f)
|
||||
.write(FileUtil.file("d:/test/pressImg_result.jpg"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user