AbstractIcon
ReferencesAbstract implementation of IIcon. Consider deriving from this base class rather than implementing IIcon from scratch. This class also has many static creation methods for creating IIcon instances from a variety of data.
Constructors
Properties
Methods
AddState
#Add a state to this icon. This method ought to be called from the constructor of derived types only.
Parameters:
| state (IconState) | State to add. |
Draw
#Render this icon into a graphics context.
Parameters:
| context (IconContext) | Graphics context for icon. |
Implements: Draw
DrawDropShadow
#Create a bitmap containing the drop shadow of this icon.
DrawToBitmap
#Render the icon to a bitmap.
Parameters:
| 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. |
Returns: Rendered bitmap.
Implements: DrawToBitmap
FindState
#Find the icon state with the specified name.
FromBitmap
#Create an image from an Eto bitmap.
Parameters:
| bitmaps (params Bitmap[]) | Bitmap. |
Returns: Image.
FromFile
#Create an icon from a grasshopper icon file (*.ghicon).
Parameters:
| fileName (string) | Filename. |
Returns: Image or null if file is not a valid image file.
FromResource
#Create an icon from named, embedded resources in the supplied assembly.
FromResource
#Create an icon from named, embedded resources in the assembly associated with the supplied type.
FromResource
#Create an icon from named, embedded resources in the assembly associated with the supplied type.
Parameters:
| type (Type) | Type associated with both the name of the icon and the assembly containing the resource. |
FromStream
#Create an icon from a stream of data. The stream must contain data written by a IStorable type. VectorIcon is but one example of such a type.
Parameters:
| stream (Stream) | Stream. |
Returns: Icon or null if stream cannot be parsed.
HandleStateChange
#Override this method if you need to respond to state changes as they happen.
Parameters:
| state (IconState) |
MoveState
#Move a named state to a new value over time.
Parameters:
| 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. |
Implements: MoveState