Modifier and Type | Class and Description |
---|---|
static class |
Icon.IconType
IconType represents the enumeration of default icon types.
|
static class |
Icon.SystemIcon |
GdiObject.ImageLoadParameters, GdiObject.ImageType, GdiObject.Type
GDI_ERROR, HGDI_ERROR
INFINITE_TIMEOUT, INVALID_HANDLE_VALUE, STATUS_ABANDONED_WAIT_0, STATUS_TIMEOUT, STATUS_WAIT_0
Constructor and Description |
---|
Icon()
Creates a NULL icon.
|
Icon(java.awt.Component c,
javax.swing.Icon icon)
Creates an icon from the standard Swing Icon.
|
Icon(java.awt.Dimension size)
Creates a NULL icon with a specified size.
|
Icon(java.io.File file)
Creates an icon from the specified file.
|
Icon(java.io.File file,
java.awt.Dimension size)
Creates an icon from the specified file.
|
Icon(Handle hInstance,
java.io.File file)
Creates an icon from the specified file.
|
Icon(Handle hInstance,
java.lang.String iconName)
Creates an icon from the executable (.exe) file associated with an
application instance.
|
Icon(java.io.InputStream stream)
Creates an icon from the specified stream.
|
Icon(java.io.InputStream stream,
java.awt.Dimension size)
Creates an icon from the specified stream.
|
Icon(long value) |
Icon(java.lang.String iconName)
Creates an icon from the executable (.exe) file associated with an
application instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getBitCount() |
IconInfo |
getIconInfo()
Returns the icon information.
|
java.awt.Dimension |
getSize()
Returns the size of the icon.
|
void |
load(java.io.File file)
Loads the icon from the specified file.
|
void |
load(java.io.File file,
java.awt.Dimension size)
Loads the icon from the specified file.
|
void |
load(Handle hInstance,
java.io.File file,
java.awt.Dimension size)
Loads the icon from the specified file.
|
void |
load(java.io.InputStream stream,
java.awt.Dimension size)
Loads the icon from the specified stream.
|
void |
load(java.io.InputStream stream,
int iconIndex)
Loads the icon from the specified stream.
|
static java.util.List |
loadFromStream(java.io.InputStream stream)
Loads the collection of all icons from the specified input stream.
|
java.awt.image.BufferedImage |
toImage()
Converts this icon to Java
BufferedImage . |
protected void |
update() |
deleteObject, getObject, getObjectType
clone, closeHandle, equals, waitFor, waitFor
asFunction, asFunction, asTypedPointer, castTo, castTo, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, write
public Icon()
public Icon(long value)
public Icon(java.awt.Dimension size)
public Icon(java.lang.String iconName)
iconName
- Name of the icon resource to be loaded.public Icon(Handle hInstance, java.lang.String iconName)
hInstance
- Handle to an instance of the module whose executable
file contains the icon to be loaded. This parameter must be NULL when a
standard icon is being loaded.iconName
- Name of the icon resource to be loaded.public Icon(java.io.File file)
file
- Specifies the file to load the image from.public Icon(java.io.File file, java.awt.Dimension size)
file
- Specifies the file to load the image from.size
- Specifies the icon size.public Icon(Handle hInstance, java.io.File file)
hInstance
- Handle to an instance of the module that contains the
image to be loaded. To load an OEM image, set this parameter to zero.file
- Specifies the file to load the image from.public Icon(java.io.InputStream stream) throws java.io.IOException
stream
- Specifies the stream to load the icon from.java.io.IOException
public Icon(java.io.InputStream stream, java.awt.Dimension size) throws java.io.IOException
stream
- Specifies the stream to load the icon from.size
- Specifies the size of the icon to find in the stream.java.io.IOException
public Icon(java.awt.Component c, javax.swing.Icon icon)
c
- Specifies the component for a paintIcon method implementation.
If the implementation allows null component argument, this parameter may be null.icon
- Specifies the standard Swing Icon.protected void update()
public void load(java.io.File file)
file
- Specifies the file to load the image from.public void load(java.io.File file, java.awt.Dimension size)
file
- Specifies the file to load the image from.size
- Specifies the size of the icon to load.public void load(Handle hInstance, java.io.File file, java.awt.Dimension size)
hInstance
- Handle to an instance of the module that contains the
image to be loaded. To load an OEM image, set this parameter to zero.file
- Specifies the file to load the image from.size
- Specifies the size of the icon to load.public void load(java.io.InputStream stream, java.awt.Dimension size) throws java.io.IOException
stream
- Specifies the stream to load the icon from.size
- Specifies the size of the icon to find in the stream.java.io.IOException
public void load(java.io.InputStream stream, int iconIndex) throws java.io.IOException
stream
- Specifies the stream to load the icon from.iconIndex
- Specifies the index of the icon in the stream.java.io.IOException
public IconInfo getIconInfo()
public java.awt.Dimension getSize()
public int getBitCount()
public java.awt.image.BufferedImage toImage()
BufferedImage
.public static java.util.List loadFromStream(java.io.InputStream stream) throws java.io.IOException
stream
- streams that contains iconsjava.io.IOException