.. | .. |
---|
66 | 66 | { |
---|
67 | 67 | BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
68 | 68 | |
---|
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 | | - } |
---|
| 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 | +// } |
---|
80 | 80 | |
---|
81 | 81 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
82 | 82 | return icon; |
---|