Normand Briere
2019-07-28 d7fd07756f4095cb87dc25d89fcffcbda092e2cf
ObjEditor.java
....@@ -60,23 +60,23 @@
6060 return new cCheckBox(icon, border);
6161 }
6262
63
- private ImageIcon GetIcon(String name)
63
+ ImageIcon GetIcon(String name)
6464 {
6565 try
6666 {
6767 BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
6868
69
-// if (image.getWidth() != 24 && image.getHeight() != 24)
70
-// {
71
-// BufferedImage resized = new BufferedImage(24, 24, image.getType());
72
-// Graphics2D g = resized.createGraphics();
73
-// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
-// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
-// g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
76
-// g.dispose();
77
-//
78
-// image = resized;
79
-// }
69
+ if (image.getWidth() > 48 && image.getHeight() > 48)
70
+ {
71
+ BufferedImage resized = new BufferedImage(48, 48, image.getType());
72
+ Graphics2D g = resized.createGraphics();
73
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
+ g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
76
+ g.dispose();
77
+
78
+ image = resized;
79
+ }
8080
8181 javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
8282 return icon;