@NonNls public final class IconUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Icon |
createScaledColourIcon(int colour)
Create a 16x16 pixel icon of a solid colour.
|
static ImageIcon |
loadScaledIcon(ClassLoader classLoader,
String path)
Load an icon from the classpath using a specific class loader.
|
static ImageIcon |
loadScaledIcon(String path)
Load an icon from the classpath using the system class loader.
|
static BufferedImage |
loadScaledImage(ClassLoader classLoader,
String path)
Load an image from the classpath using a specific class loader.
|
static BufferedImage |
loadScaledImage(String path)
Load an image from the classpath using the system class loader.
|
static BufferedImage |
loadUnscaledImage(String path)
Load an image from the classpath using the system class loader.
|
static ImageIcon |
scaleIcon(ImageIcon icon,
int size)
Scale a square icon using bicubic scaling.
|
static BufferedImage |
scaleIcon(Image iconImage,
int size)
Scale a square icon using bicubic scaling.
|
public static ImageIcon loadScaledIcon(String path)
The icon will automatically be scaled up for HiDPI displays.
path - The path of the image to load.null if the specified path
did not contain a resource.public static ImageIcon loadScaledIcon(ClassLoader classLoader, String path)
The icon will automatically be scaled up for HiDPI displays.
classLoader - The class loader to use to load the image.path - The path of the image to load.null if the specified path
did not contain a resource.public static BufferedImage loadUnscaledImage(String path)
The image will be returned at its original resolution and not be rescaled.
path - The path of the image to load.null if the specified path
did not contain a resource.public static BufferedImage loadScaledImage(String path)
The image will automatically be scaled up for HiDPI displays.
path - The path of the image to load.null if the specified path
did not contain a resource.public static BufferedImage loadScaledImage(ClassLoader classLoader, String path)
The image will automatically be scaled up for HiDPI displays.
classLoader - The class loader to use to load the image.path - The path of the image to load.null if the specified path
did not contain a resource.public static Icon createScaledColourIcon(int colour)
The icon will automatically be scaled up for HiDPI displays.
colour - The colour as a combined rgb value.public static ImageIcon scaleIcon(ImageIcon icon, int size)
The icon will automatically be scaled up for HiDPI displays.
icon - The icon to scale.size - The size (edge to edge) of the scaled icon.public static BufferedImage scaleIcon(Image iconImage, int size)
The icon will automatically be scaled up for HiDPI displays.
iconImage - The icon to scale.size - The size (edge to edge) of the scaled icon.