[IoId("00000000-ba64-4792-9acf-45bd1328dfc9")] public class VectorIcon : AbstractIcon, IStorable
Implements IIcon for vector graphics.

Constructors

VectorIcon

#
public VectorIcon(Builder builder)
Create a new vector icon.
builder (Builder)Builder with all vector shapes and states.

VectorIcon

#
public VectorIcon(IReader reader)
Deserialisation constructor.
reader (IReader)

Fields

NullRank

#
public const int NullRank = -2147483648
Defines the null category, ie. the category that cannot be hidden.

Properties

Size

#
public Size Size { get; }
Gets the frame within which this icon is positioned.

States

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

Type

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

Methods

AddState

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

Draw

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

DrawDropShadow

public Bitmap DrawDropShadow(Size size, int blur, float strength)
Create a bitmap containing the drop shadow of this icon.
inherited fromAbstractIcon
size (Size)Size of the icon in pixels.
blur (int)Amount of blurring.
strength (float)Darkness of shadow.
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(IconContext context)
Internal render method.
context (IconContext)Graphics context.

DrawToBitmap

public Bitmap DrawToBitmap(Size size, int padding, Color background)
Render the icon to a bitmap.
inherited fromAbstractIcon
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.
DrawToBitmap

FindState

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

HandleStateChange

#
protected override void HandleStateChange(IconState state)
state (IconState)

Hide

#
public void Hide(int rank)
Hide a specific category.
rank (int)Category to show.

MoveState

public void MoveState(double value, string name = null, Duration? duration = null, Motion? motion = null)
Move a named state to a new value over time.
inherited fromAbstractIcon
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.
MoveState

SetState

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

Show

#
public void Show(int rank)
Show (ie. unhide) a specific category.
rank (int)Category to show.

ShowAll

#
public void ShowAll()
Show all categories.

ShowOnly

#
public void ShowOnly(int rank)
Show a single category, hide all others.
rank (int)Category to show.

Store

#
public void Store(IWriter writer)
Serialise this icon.
writer (IWriter)
Store

ToSvgXml

#
public string ToSvgXml()
Create an xml document from this icon.