Java Swing Icon getSize(String graphIconPath)

Here you can find the source of getSize(String graphIconPath)

Description

Retrieve image size's

License

Apache License

Parameter

Parameter Description
graphIconPath a parameter

Declaration

public static int[] getSize(String graphIconPath) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.ImageIcon;

public class Main {
    /**/*from   www.  jav  a 2 s  . c o m*/
     * Retrieve image size's
     * 
     * @param graphIconPath
     * @return
     */
    public static int[] getSize(String graphIconPath) {
        if (graphIconPath != null && !graphIconPath.isEmpty()) {
            ImageIcon image = new ImageIcon(graphIconPath);
            return new int[] { image.getIconWidth(), image.getIconHeight() };
        } else {
            return new int[] { 150, 75 };
        }
    }
}

Related

  1. getPressedExitIcon(int x, int y)
  2. getResourceIcon(Object target, String name)
  3. getScaledIcon(Icon icon)
  4. getScaledIcon(Icon tmpIcon, int w, int h, boolean incr)
  5. getScaledIcon(String resourceName, int width, int height)
  6. getTransparentIcon(int width)
  7. getVerBumpIcon()
  8. grayIcon(Icon icon)
  9. iconFromStream(final InputStream in)