public interface ResizableIcon
extends javax.swing.Icon
ResizableIcon can handle rendered images such as png, jpeg, or gif as well as svg vector images.
To obtain an instance of ResizableIcon use APIUtils.getResizableIcon(BufferedImage) or APIUtils.getResizableIcon(java.net.URL)| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getExtension()
Returns the extension of the file png or svg.
|
ResizableIcon |
getScaledIcon(double scale)
Returns a scaled instance of this image.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics2D g,
int x,
int y,
int w,
int h)
Paints the image on the given
Graphics2D. |
void |
save(java.io.OutputStream o)
Save the current image into the given output stream.
|
void paintIcon(java.awt.Component c,
java.awt.Graphics2D g,
int x,
int y,
int w,
int h)
Graphics2D. The Component can be null and is used as ImageObserver if exists.c - the Component used as ImageObserver. It can be null.g - the Graphics2D on which the image is paintedx - the horizontal location on the Graphics2Dy - the vertical location on the Graphics2Dw - the target widthh - the target heightvoid save(java.io.OutputStream o) throws java.io.IOException
o - the target output streamjava.io.IOException - if an error occurs during savingjava.lang.String getExtension()
ResizableIcon getScaledIcon(double scale)
scale - the scaling factor applied to the image