ClassImagePrimitive
Represents a primitive element that renders images with comprehensive scaling, layout, transformation, and caching capabilities.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
public class ImagePrimitive : BasePrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, IImageElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitiveImagePrimitive
Implements:
Inherited Members
Constructors
ImagePrimitive()
Declaration
public ImagePrimitive()
Fields
ImageScalingProperty
Declaration
public static RadProperty ImageScalingProperty
Field Value
TransparentColorProperty
Declaration
public static RadProperty TransparentColorProperty
Field Value
UseSmallImageListProperty
Declaration
public static RadProperty UseSmallImageListProperty
Field Value
Properties
ActualIndex
Gets actual index.
Declaration
[Browsable(false)]
public virtual int ActualIndex { get; }
Property Value
Image
Gets or sets the image that is displayed.
Declaration
[TypeConverter(typeof(ImageTypeConverter))]
public Image Image { get; set; }
Property Value
Implements
ImageDrawType
Determines whether the Image or SvgImage property will be painted. Note that if SvgImage == null, this property will always return "ImageDrawType.Image".
Declaration
[Browsable(false)]
public ImageDrawType ImageDrawType { get; set; }
Property Value
ImageIndex
Gets or sets the image list index value of the displayed image.
Declaration
[RelatedImageList("ElementTree.Control.ImageList")]
public int ImageIndex { get; set; }
Property Value
Implements
ImageKey
Gets or sets the key accessor for the image in the ImageList.
Declaration
[RelatedImageList("ElementTree.Control.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.1.217.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public string ImageKey { get; set; }
Property Value
Implements
ImageLayout
Gets or sets the way ImagePrimitive will layout its image on the screen.
Declaration
public ImageLayout ImageLayout { get; set; }
Property Value
ImageScaling
Gets or sets image scaling. Possible values are members of ImageScaling enumeration: None and SizeToFit.
Declaration
public ImageScaling ImageScaling { get; set; }
Property Value
IsEmpty
Gets a value indicating whether the primitive has content.
Declaration
[Browsable(false)]
public override bool IsEmpty { get; }
Property Value
Overrides
RenderImage
Gets the Image that will be painted on the screen, with settings such as Opacity and Flip applied.
Declaration
[Browsable(false)]
public Image RenderImage { get; }
Property Value
RotateFlipType
Gets or sets the type of rotate/flip to be applied.
Declaration
public RotateFlipType RotateFlipType { get; set; }
Property Value
ScaleSize
Gets or sets the desired size to be used when displaying the image. Works when ImageScalingMode is set to FitToSize.
StretchHorizontally
Gets or sets the flag controlling whether the image primitive fills up the available area horizontally
Declaration
public override bool StretchHorizontally { get; set; }
Property Value
Overrides
StretchVertically
Gets or sets the flag controlling whether the image primitive fills up the available area vertically
Declaration
public override bool StretchVertically { get; set; }
Property Value
Overrides
SvgImage
Gets or sets the image that is displayed.
TransparentColor
Gets or sets the transparent color for the image
Declaration
[TypeConverter(typeof(RadColorEditorConverter))]
public Color TransparentColor { get; set; }
Property Value
UseSmallImageList
Specifies whether the image should be taken from the SmallImageList or from the ImageList when the ImageIndex/ImageKey property is set.
Methods
DisposeManagedResources()
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
Declaration
protected override void DisposeManagedResources()
Overrides
GetStylablePropertiesFilter()
Gets the IFilter instance that may be used to filter the properties, treated as Stylable for this element.
Declaration
public override Filter GetStylablePropertiesFilter()
Returns
Overrides
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the space required by the RadElement
Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
availableSize
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns
The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides
Remarks
In this method call to the Measure method of each child must be made.
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value has changed, allowing for custom response to property changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The property changed event arguments.
Overrides
OnTunnelEvent(RadElement, RoutedEventArgs)
Called when the tunnel phase of a routed event occurs.
Declaration
protected override void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
Parameters
sender
The element that originally raised the event.
args
The routed event arguments.
Overrides
OnUnloaded(ComponentThemableElementTree)
Notifies that the element has been successfully unloaded from an element tree. Allows inheritors to provide custom logic at this stage.
Declaration
protected override void OnUnloaded(ComponentThemableElementTree oldTree)
Parameters
oldTree
Reference to the element tree from which the element has been unloaded.
Overrides
PaintPrimitive(IGraphics, float, SizeF)
Draws the primitive on the screen.
ShouldSerializeProperty(PropertyDescriptor)
Determines whether the property defined by the provided property descriptor should be serialized.
Declaration
public override bool? ShouldSerializeProperty(PropertyDescriptor property)
Parameters
property
Returns
bool?
Overrides