PixelIcon

AbstractIcon
[IoId("00000000-c661-40c2-9323-56a2f3d911d3")] public sealed class PixelIcon : AbstractIcon, IStorable
Implements IIcon for bitmap icons.

Constructors

PixelIcon

#
public PixelIcon(
reader
)

PixelIcon

#
Create a new pixel icon from a collection of bitmap images.
public PixelIcon(
params Bitmap[]
bitmaps
Collection of variable resolution bitmaps. All bitmaps must have significantly different diagonal dimensions.
)

PixelIcon

#
Create a new pixel icon from a collection of bitmap image files.
public PixelIcon(
params string[]
bitmapFiles
Files.
)

Properties

ImageCount

#
Gets the number of images stored in this icon.
public int ImageCount { get; }

LargestSize

#
Gets the size of the largest image.
public Size LargestSize { get; }

LargestSpan

#
Gets the span (diagonal) of the largest image.
public int LargestSpan { get; }

SmallestSize

#
Gets the size of the smallest image.
public Size SmallestSize { get; }

SmallestSpan

#
Gets the span (diagonal) of the smallest image.
public int SmallestSpan { get; }

States

Enumerate over all state names.
public IEnumerable<IconState> States { get; }
inherited fromAbstractIcon
States

Type

Gets the type of icon.
public IconType Type { get; }
inherited fromAbstractIcon
Type

Indexers

this[]

#
Gets the image associated with the given index.
public Bitmap this[
index
Index of image to retrieve.
] { get; }
Image at index.

Methods

AddState

Add a state to this icon. This method ought to be called from the constructor of derived types only.
protected void AddState(
state
State to add.
)
inherited fromAbstractIcon

BestMatch

#
Find the best match image for a specific span.
public int BestMatch(
span,
Span.
out float
factor
Scaling factor to be applied to found image.
)
Index of best match.

Draw

Render this icon into a graphics context.
public void Draw(
context
Graphics context for icon.
)
inherited fromAbstractIcon
Draw

DrawDropShadow

Create a bitmap containing the drop shadow of this icon.
public Bitmap DrawDropShadow(
Size
size,
Size of the icon in pixels.
blur,
Amount of blurring.
strength
Darkness of shadow.
)
inherited fromAbstractIcon
A bitmap with only black pixels and varying transparencies. The size of this bitmap is the provided size plus padding to cater for the blurring.

DrawInternal

#
protected override void DrawInternal(
context
)

DrawToBitmap

Render the icon to a bitmap.
public Bitmap DrawToBitmap(
Size
size,
Size of bitmap.
padding,
Number of padding pixels around entire image.
Color
background
Icon background colour. Note that the actual bitmap will be drawn on a Transparent background. This argument merely informs those parts of icon that case about background/foreground contrast.
)
inherited fromAbstractIcon
Rendered bitmap.
DrawToBitmap

ExactMatchOrLarger

#
Find the image which matches the span or the first larger one. If there are no larger images, the largest possible image will be returned.
public int ExactMatchOrLarger(
span
Span.
)
Index of found image.

ExactMatchOrLarger

#
Find the image which matches the span or the first larger one. If there are no larger images, the largest possible image will be returned.
public int ExactMatchOrLarger(
Rectangle
frame
Span frame.
)
Index of found image.

ExactMatchOrLarger

#
Find the image which matches the span or the first larger one. If there are no larger images, the largest possible image will be returned.
public int ExactMatchOrLarger(
Size
size
Span size.
)
Index of found image.

ExactMatchOrSmaller

#
Find the image which matches the span or the first smaller one. If there are no smaller images, the smallest possible image will be returned.
public int ExactMatchOrSmaller(
span
Span.
)
Index of found image.

ExactMatchOrSmaller

#
Find the image which matches the span or the first smaller one. If there are no smaller images, the smallest possible image will be returned.
public int ExactMatchOrSmaller(
Rectangle
frame
Span frame.
)
Index of found image.

ExactMatchOrSmaller

#
Find the image which matches the span or the first smaller one. If there are no smaller images, the smallest possible image will be returned.
public int ExactMatchOrSmaller(
Size
size
Span size.
)
Index of found image.

FindState

Find the icon state with the specified name.
public IconState FindState(
name
Name to search for.
)
inherited fromAbstractIcon
Icon state with given name or null.
FindState

HandleStateChange

Override this method if you need to respond to state changes as they happen.
protected virtual void HandleStateChange(
state
)
inherited fromAbstractIcon

MoveState

Move a named state to a new value over time.
public void MoveState(
value,
State value to assign.
name = null,
Name of state. Leave blank to set the default state.
duration = null,
Animation duration. Leave blank to re-use the previous duration.
motion = null
Animation motion. Leave blank to re-use the previous motion.
)
inherited fromAbstractIcon
MoveState

SetState

Set the value of a named state immediately.
public void SetState(
value,
State value to assign.
name = null
Name of state. Leave blank to set the default state.
)
inherited fromAbstractIcon
SetState

Store

#
public void Store(
writer
)
Store