MCPcopy Create free account
hub / github.com/SummerSec/SPATool / setImage

Method setImage

src/main/java/com/sumsec/core/cfg/ImageUtil.java:28–61  ·  view source on GitHub ↗
(String[] iURL)

Source from the content-addressed store, hash-verified

26 private static Logger log = LogManager.getLogger(ImageUtil.class);
27
28 public void setImage(String[] iURL) {
29 for (String url : iURL) {
30 log.info("iURL: " + url);
31 try {
32 sleep(1000);
33 } catch (InterruptedException e) {
34 e.printStackTrace();
35 }
36 File file = new File(url);
37 if (!file.exists()) {
38 log.error("文件不存在");
39 Alert alert = new Alert(Alert.AlertType.ERROR);
40 alert.setTitle("错误");
41 alert.setHeaderText("文件不存在");
42 alert.setContentText("请检查是否成功生成文件 "+ url);
43 alert.show();
44 } else {
45 try {
46 ImageBak.image = ImageIO.read(file);
47 } catch (IOException e) {
48 e.printStackTrace();
49 }
50 int Height = ImageBak.image.getHeight() + 100;
51 int Width = ImageBak.image.getWidth() + 100;
52 log.info("图片大小 width:" + Width + " height:" + Height);
53// new ImageBak(Width, Height);
54 try {
55 new Images(file);
56 } catch (IOException e) {
57 log.info(e.getMessage());
58 }
59 }
60 }
61 }
62
63
64 public String[] Dot2Image(){

Callers 1

CFGGMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected