-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.java
More file actions
42 lines (33 loc) · 1.1 KB
/
Copy pathtest.java
File metadata and controls
42 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package getInfoFromImage;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import junit.framework.Assert;
import getInfoFromImage.test2;
public class test {
/*public static void main(String[] args){
try {
new test().testRotate(1,10);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}*/
public void testRotate(String filepath,int c,int b,int a) throws IOException {
//"C://Users//BZP//Desktop//im.png"
BufferedImage src = ImageIO.read(new File(filepath));
BufferedImage des = test2.Rotate(src, a);
Assert.assertNotNull(des);
Assert.assertTrue(ImageIO.write(des, "jpg", new File("C://Users//BZP//Desktop//aaaa//d"+c+"og"+b+".png")));
System.out.println("生成成功");
// bigger angel
/*des = test2.Rotate(src, 150);
Assert.assertNotNull(des);
Assert.assertTrue(ImageIO.write(des, "jpg", new File("d:/dog3.jpg")));*/
// bigger angel
/*des = test2.Rotate(src, 270);
Assert.assertNotNull(des);
Assert.assertTrue(ImageIO.write(des, "jpg", new File("d:/dog4.jpg")));*/
}
}