PixelIcon
AbstractIcon[IoId("00000000-c661-40c2-9323-56a2f3d911d3")]
public sealed class PixelIcon : AbstractIcon, IStorable
Implements IIcon for bitmap icons.
Constructors
PixelIcon
#public PixelIcon(params Bitmap[] bitmaps)
Create a new pixel icon from a collection of bitmap images.
Parameters:
| bitmaps (params Bitmap[]) | Collection of variable resolution bitmaps. All bitmaps must have significantly different diagonal dimensions. |
Properties
Implements: States
Implements: Type
Indexers
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. |
BestMatch
#Find the best match image for a specific span.
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
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.
Parameters:
| span (int) | Span. |
Returns: 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.
Parameters:
| frame (Rectangle) | Span frame. |
Returns: 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.
Parameters:
| size (Size) | Span size. |
Returns: 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.
Parameters:
| span (int) | Span. |
Returns: 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.
Parameters:
| frame (Rectangle) | Span frame. |
Returns: 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.
Parameters:
| size (Size) | Span size. |
Returns: Index of found image.
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
SetState
Set the value of a named state immediately.