public static interface IIcon.ImageList
Modifier and Type | Field and Description |
---|---|
static int |
MATCH_EXACT
An option for getMatchFor() specifying that the image found must match the specified dimensions exactly.
|
static int |
MATCH_SCALE_DOWN
An option for getMatchFor() specifying that if an exact match could not be found that the closest bigger
image should be accepted.
|
static int |
MATCH_SCALE_HEIGHT_PRIORITY
An option for getMatchFor() specifying that if an exact match could not be found
and either a smaller or bigger image is to be used, then make getting the closest height the priority.
|
static int |
MATCH_SCALE_UP
An option for getMatchFor() specifying that if an exact match could not be found that the closest smaller
image should be accepted.
|
static int |
MATCH_SCALE_WIDTH_PRIORITY
An option for getMatchFor() specifying that if an exact match could not be found
and either a smaller or bigger image is to be used, then make getting the closest width the priority.
|
Modifier and Type | Method and Description |
---|---|
int |
countImages()
Count the number of images in the ImageList.
|
IImage |
getImage(int indexOfImage,
PixelBuffer dest)
Get the image at the specified index either by copying into the PixelBuffer provided
or by returning an IImage object.
|
Dimension |
getImageDimension(int indexOfImage,
Dimension dest)
Get the dimensions of the specified image.
|
int |
getImageFlags(int indexOfImage)
The flags for the images.
|
int |
getMatchFor(int width,
int height,
int matchOptions)
Get the index of the image matching the specified dimensions.
|
PixelBuffer |
getScaled(int width,
int height,
int matchOptions,
boolean keepAspect,
PixelBuffer destination)
Get the best scaled version of the image as a PixelBuffer.
|
boolean |
hasMixedTransparencyImages()
Returns if any of the images have mixed transparencies, that is any image where there are pixels
where the alpha value is not completely opaque or completely transparent.
|
void |
releaseGetImage(IImage im)
Call this if you no longer need the image returned by getImage().
|
static final int MATCH_EXACT
static final int MATCH_SCALE_DOWN
static final int MATCH_SCALE_UP
static final int MATCH_SCALE_HEIGHT_PRIORITY
static final int MATCH_SCALE_WIDTH_PRIORITY
int countImages()
Dimension getImageDimension(int indexOfImage, Dimension dest)
dest
- the destination Dimension or null to create and return a new one.int getImageFlags(int indexOfImage)
indexOfImage
- the index of the image.boolean hasMixedTransparencyImages()
IImage getImage(int indexOfImage, PixelBuffer dest)
indexOfImage
- the index of the image to fetch.dest
- an optional PixelBuffer destination. If this is NOT null, it will be
resized and set to the Image at the specified index.void releaseGetImage(IImage im)
im
- the image returned by getImage().int getMatchFor(int width, int height, int matchOptions)
width
- the width to match or 0 to match only the height.height
- the height to match or 0 to match only the width.matchOptions
- one of the MATCH_XXX options.PixelBuffer getScaled(int width, int height, int matchOptions, boolean keepAspect, PixelBuffer destination)
width
- the requested width, or zero to indicate that it is not specified, in which case height must not be zero.height
- the requested height, or zero to indicate that it is not specified, in which case width must not be zero.matchOptions
- any combination of the MATCH_XXX options.keepAspect
- true to keep the aspect ratio of the icon. The ImageList may choose to keep the aspect ratio even
if this parameter is false.destination
- an optional destination PixelBuffer.