public interface IIcon
Base interface for icons and other UI images. This type does *not* wrap bitmaps, but instead represents scale-agnostic, relatively small images of either vector, pixel or algorithmic contents.

Properties

States

#
IEnumerable<IconState> States { get; }
Enumerate over all state names.

Type

#
IconType Type { get; }
Gets the type of icon.

Methods

Draw

#
void Draw(IconContext context)
Render this icon into a graphics context.
context (IconContext)Graphics context for icon.

DrawToBitmap

#
Bitmap DrawToBitmap(Size size, int padding, Color background)
Render the icon to a bitmap.
size (Size)Size of bitmap.
padding (int)Number of padding pixels around entire image.
background (Color)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.
Rendered bitmap.

FindState

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

MoveState

#
void MoveState(double value, string name = null, Duration? duration = null, Motion? motion = null)
Move a named state to a new value over time.
value (double)State value to assign.
name (string = null)Name of state. Leave blank to set the default state.
duration (Duration? = null)Animation duration. Leave blank to re-use the previous duration.
motion (Motion? = null)Animation motion. Leave blank to re-use the previous motion.

SetState

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