Class ImageDrawable
Represents a drawable object that can display an image, including support for SVG images and various image states (enabled/disabled). This class provides properties to specify the image source, color, size, and alignment options. It also includes methods to retrieve the appropriate image based on the control's state and to perform default drawing of the image within a specified control and drawing context.
public class ImageDrawable : BaseDrawable, IBaseObject, IBaseDrawable
- Inheritance
-
ImageDrawable
- Implements
- Derived
- Extension Methods
Properties
- CenterHorz
Gets or sets whether to center this object horizontally. Default is
true. This property is used when the image is smaller than the available space, and it determines whether the image should be centered horizontally or aligned to the left. There is more advanced centering logic via the VerticalAlignment and HorizontalAlignment properties.
- CenterHorzOrVert
Gets whether or not center this object horizontally or vertically.
- CenterVert
Gets or sets whether to center this object vertically. Default is
true. This property is used when the image is smaller than the available space, and it determines whether the image should be centered vertically or aligned to the top. There is more advanced centering logic via the VerticalAlignment and HorizontalAlignment properties.
- CornerRadiusX
Gets or sets the horizontal corner radius for rounded corners.
- CornerRadiusY
Gets or sets the vertical corner radius for rounded corners.
- DisabledImage
Gets or sets image to draw.
- DisabledImageSet
Gets or sets image to draw.
- HorizontalAlignment
Gets or sets horizontal alignment option that specifies how the image should be aligned within the available space. This property is used when the image is smaller than the available space.
- Icon
Gets or sets icon to draw.
- Image
Gets or sets image to draw.
- ImageSet
Gets or sets image to draw.
- IsImageSpecified
Gets a value indicating whether the object has an associated image.
- IsLeftTopAligned
Gets or sets whether image is aligned to the left-top of the available space.
- SizeFallbackOptions
Gets or sets image size fallback options that determine how to handle cases where the specified image size is not available in the IconSet or other containers.
- Stretch
Gets whether or not to stretch this object.
- SvgColor
Gets or sets the color used to render the SVG image.
- SvgImage
Gets or sets the SVG image associated with this instance.
- SvgSize
Gets or sets the size of the SVG image in pixels.
- UseCornerRadius
Gets or sets a value indicating whether the image should be painted with round corners.
- VerticalAlignment
Gets or sets vertical alignment option that specifies how the image should be aligned within the available space. This property is used when the image is smaller than the available space.
Methods
- DefaultDrawImage(AbstractControl, Graphics)
Performs default drawing of the image.
- GetImage(AbstractControl, bool)
Gets image to draw.
- GetPreferredSize(AbstractControl)
Gets preferred size in device-independent units.
- OnDraw(AbstractControl, Graphics)
Performs custom drawing operations for the specified control.
- ResetCachedImages()
Resets any cached images associated with the current instance.
- SetSvgSize(int)
Sets svg size. Implemented for the convenience.