List of utility methods to do Image
ImageIcon | getLogoImage() Returns an ImageIcon of the logo (large image). return getIcon("MEKA.png"); |
Image | getManagedImage(Component source, String file, float tint, Color solid) gets a managed image with the specified alpha tinting and all that jazz if (!(new File(file)).exists()) { return null; Image imageData = new javax.swing.ImageIcon(file).getImage(); if (tint > 0) { Image imageDataTinted = source.createImage(imageData.getWidth(null), imageData.getHeight(null)); Graphics2D g2 = (Graphics2D) imageDataTinted.getGraphics(); Composite oc = g2.getComposite(); ... |
JFileChooser | getNewImageFileChooser() get New Image File Chooser return getNewFileChooser(FILE_FILTER_TIFF, FILE_FILTER_PNG);
|
ImageIcon | getOpenSwingImage(String name) get Open Swing Image return getOpenSwingImage(name, null);
|
Image | getPanelImage(JPanel p) I think it's more expensive to layout 1000 charts than it is to layout 1000 already rendered (fixed) images. JFrame frame; frame = new JFrame(); frame.setContentPane(p); frame.pack(); Dimension size = p.getPreferredSize(); BufferedImage image = new BufferedImage((int) size.width, (int) size.height, BufferedImage.TYPE_INT_RGB); p.paint(image.createGraphics()); return (image); ... |
Image | getScreenShareImage() get Screen Share Image Image image = new ImageIcon(Thread.currentThread().getContextClassLoader().getResource("images/share.png")) .getImage().getScaledInstance(16, 16, Image.SCALE_AREA_AVERAGING); return image; |
Image | getShieldImage() get Shield Image String path = new File(recordSheetPath).getAbsolutePath() + File.separatorChar; Image image = new ImageIcon(path + "twbiped-shields.png").getImage(); return image; |
Image | getWindowImage(Window window) get Window Image try { if (window instanceof JFrame) { return ((JFrame) window).getIconImage(); if (window instanceof JDialog) { return ((JDialog) window).getIconImages().get(0); } catch (Exception e) { ... |
Image | imageOf(Action action) image Of ImageIcon icon = (ImageIcon) action.getValue(AbstractAction.SMALL_ICON);
return icon == null ? null : icon.getImage();
|
Icon | initVistaDragTextureImage() Dynamically creates and returns drag texture icon BufferedImage i = new BufferedImage(2, 2, BufferedImage.TYPE_INT_RGB); int grey = new Color(124, 124, 124).getRGB(); i.setRGB(1, 0, grey); i.setRGB(0, 1, grey); i.setRGB(0, 0, new Color(162, 163, 164).getRGB()); i.setRGB(1, 1, new Color(107, 107, 107).getRGB()); return new ImageIcon(i); |