Class RadPictureBox
A control that displays raster or vector images with advanced features including zooming, panning, and image editing capabilities.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Editors")]
public class RadPictureBox : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Constructors
RadPictureBox()
Properties
AllowPanelAnimations
Gets or sets a value indicating whether to show animations when showing and hiding panels. Note that animations are applied only when PanelDisplayMode is set to OnMouseHover.
Declaration
public bool AllowPanelAnimations { get; set; }
Property Value
|
System.Boolean
|
BottomPanel
Gets the bottom panel element. This panel allows adding buttons label and other elements in three collections - left, center and right items.
Declaration
public PictureBoxHorizontalPanelElement BottomPanel { get; }
Property Value
|
PictureBoxHorizontalPanelElement
|
ContextMenuDropDown
Gets the context menu.
Declaration
public RadContextMenuDropDown ContextMenuDropDown { get; }
Property Value
|
RadContextMenuDropDown
|
ContextMenuEnabled
Gets or sets a value indicating whether to display context menu on right mouse click.
Declaration
public bool ContextMenuEnabled { get; set; }
Property Value
|
System.Boolean
|
ContextMenuProperties
Gets the context menu related properties.
Declaration
public PictureBoxContextMenuProperties ContextMenuProperties { get; }
Property Value
|
PictureBoxContextMenuProperties
|
DefaultImage
Gets or sets the raster image which is displayed when the Image and SvgImage properties are not specified.
Declaration
public Image DefaultImage { get; set; }
Property Value
|
System.Drawing.Image
|
DefaultSize
Gets the default size of the RadPictureBox when a new instance is initialized.
Declaration
protected override Size DefaultSize { get; }
Property Value
|
System.Drawing.Size
|
DefaultSvgImage
Gets or sets the vector (SVG) image displayed when no main image is specified.
Declaration
public RadSvgImage DefaultSvgImage { get; set; }
Property Value
|
RadSvgImage
The default RadSvgImage to display, or null if no default SVG image is set. |
DefaultSvgImageXml
This property is not relevant for this class.
Declaration
public string DefaultSvgImageXml { get; set; }
Property Value
|
System.String
|
DefaultText
Declaration
public string DefaultText { get; set; }
Property Value
|
System.String
|
Image
Gets or sets the raster image displayed in the control. Note: If both Image and SvgImage have values, the SvgImage will be displayed with higher precedence.
Declaration
public Image Image { get; set; }
Property Value
|
System.Drawing.Image
The System.Drawing.Image to display, or null if no image is set. |
ImageAlignment
Gets or sets the alignment of the image on the drawing surface. Default is TopLeft. Note that this property is respected only when the ImageLayout is set to None.
Declaration
public ContentAlignment ImageAlignment { get; set; }
Property Value
|
System.Drawing.ContentAlignment
|
ImageEditorDialog
Gets or sets the dialog responsible for image editing.
Declaration
public PictureBoxImageEditorDialog ImageEditorDialog { get; set; }
Property Value
|
PictureBoxImageEditorDialog
|
ImageLayout
Specifies how the image is positioned on the control.
Declaration
public RadImageLayout ImageLayout { get; set; }
Property Value
|
RadImageLayout
|
LeftPanel
Gets the left panel element. This panel allows adding buttons label and other elements in three collections - top, center and bottom items.
Declaration
public PictureBoxVerticalPanelElement LeftPanel { get; }
Property Value
|
PictureBoxVerticalPanelElement
|
PanelDisplayMode
Gets or sets a value indicating how the panels are displayed. The possible options are: always or on mouse hover.
Declaration
public PictureBoxPanelDisplayMode PanelDisplayMode { get; set; }
Property Value
|
PictureBoxPanelDisplayMode
|
PanelOverflowMode
Gets or sets a value indicating how the panels are positioned.
Declaration
public PictureBoxPanelOverflowMode PanelOverflowMode { get; set; }
Property Value
|
PictureBoxPanelOverflowMode
|
PictureBoxElement
Gets the main element of the picture box control.
Declaration
public RadPictureBoxElement PictureBoxElement { get; }
Property Value
|
RadPictureBoxElement
The RadPictureBoxElement that contains the picture box functionality. |
ReadOnly
Determines if users can only view the image with no interaction: zoom and context menu are not available when read only is true.
Declaration
public bool ReadOnly { get; set; }
Property Value
|
System.Boolean
|
RightPanel
Gets the right panel element. This panel allows adding buttons label and other elements in three collections - top, center and bottom items.
Declaration
public PictureBoxVerticalPanelElement RightPanel { get; }
Property Value
|
PictureBoxVerticalPanelElement
|
ShowBackground
Gets or sets a value indicating whether to display control background(fill).
Declaration
public bool ShowBackground { get; set; }
Property Value
|
System.Boolean
|
ShowBorder
Gets or sets a value indicating whether to display control border.
Declaration
public bool ShowBorder { get; set; }
Property Value
|
System.Boolean
|
ShowScrollBars
Gets or sets a value indicating whether to display scrollbars when the displayed image is larger than the control, or when the user zooms-in and the zoomed image size exceeds the size of the control.
Declaration
public bool ShowScrollBars { get; set; }
Property Value
|
System.Boolean
|
SvgImage
Gets or sets the vector (SVG) image displayed in the control. Note: If both Image and SvgImage have values, the SvgImage will be displayed with higher precedence.
Declaration
public RadSvgImage SvgImage { get; set; }
Property Value
|
RadSvgImage
The RadSvgImage to display, or null if no SVG image is set. |
SvgImageXml
This property is not relevant for this class.
Declaration
public string SvgImageXml { get; set; }
Property Value
|
System.String
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
|
System.String
|
Overrides
TopPanel
Gets the top panel element. This panel allows adding buttons label and other elements in three collections - left, center and right items.
Declaration
public PictureBoxHorizontalPanelElement TopPanel { get; }
Property Value
|
PictureBoxHorizontalPanelElement
|
ZoomProperties
Gets the properties responsible for the zoom operations.
Declaration
public PictureBoxZoomProperties ZoomProperties { get; }
Property Value
|
PictureBoxZoomProperties
|
Methods
ClearImage()
Removes the image and/or svg image.
Declaration
public void ClearImage()
CopyImage()
Copies the displayed image into the clipboard.
Declaration
public void CopyImage()
CreateChildItems(RadElement)
Creates the child elements by instantiating and adding the main picture box element.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
|
RadElement
parent
The parent RadElement to which child elements will be added. |
Overrides
CreateImageEditorElement()
This method is not relevant for this class.
Declaration
[Obsolete("Use CreatePictureBoxElement method instead.")]
protected virtual RadPictureBoxElement CreateImageEditorElement()
Returns
|
RadPictureBoxElement
A new instance of RadPictureBoxElement. |
CreatePictureBoxElement()
Creates a new instance of the RadPictureBoxElement class used as main element.
Declaration
protected virtual RadPictureBoxElement CreatePictureBoxElement()
Returns
|
RadPictureBoxElement
A new instance of RadPictureBoxElement. |
CutImage()
Copies the displayed image into the clipboard and clears the displayed image.
Declaration
public void CutImage()
LoadImage()
Opens an OpenFileDialog which allows the user to choose an image.
Declaration
public void LoadImage()
OnLoad(Size)
Handles the Load event by enabling gesture support for pan and zoom operations.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
|
System.Drawing.Size
desiredSize
The desired size for the control. |
Overrides
PasteImage()
Pastes an image from the clipboard.
Declaration
public void PasteImage()
SaveImage()
Opens a SaveFileDialog which allows the user to save the displayed image.
Declaration
public void SaveImage()
Events
ContextMenuClosed
Occurs when the context menu is closed.
Declaration
public event EventHandler ContextMenuClosed
Event Type
|
System.EventHandler
|
ContextMenuClosing
Occurs when the context menu is closing.
Declaration
public event CancelEventHandler ContextMenuClosing
Event Type
|
System.ComponentModel.CancelEventHandler
|
ContextMenuItemClick
Occurs when an item in the context menu is clicked.
Declaration
public event HandledEventHandler ContextMenuItemClick
Event Type
|
System.ComponentModel.HandledEventHandler
|
ContextMenuOpened
Occurs when the context menu is opened.
Declaration
public event EventHandler ContextMenuOpened
Event Type
|
System.EventHandler
|
ContextMenuOpening
Occurs when the context menu is opening.
Declaration
public event CancelEventHandler ContextMenuOpening
Event Type
|
System.ComponentModel.CancelEventHandler
|
ImageEdited
Occurs when the image has been edited by the ImageEditorDialog and the user has accepted the changes. Can be handled. Note that this event fill be fired always when the user clicks the OK button of the dialog, even if there are no changes in the image.
Declaration
public event PictureBoxImageEditedEventHandler ImageEdited
Event Type
|
PictureBoxImageEditedEventHandler
|
ImageEditorOpening
Occurs when the image is about to be edited in the ImageEditorDialog. Cancellable.
Declaration
public event PictureBoxImageEditorOpeningEventHandler ImageEditorOpening
Event Type
|
PictureBoxImageEditorOpeningEventHandler
|
ImageLoaded
Occurs when a raster or vector(SVG) image has been loaded by the user.
Declaration
public event EventHandler ImageLoaded
Event Type
|
System.EventHandler
|
ImageSaved
Occurs when the displayed image has been saved by the user.
Declaration
public event EventHandler ImageSaved
Event Type
|
System.EventHandler
|
PanChanged
Occurs when the PositionOffset property of PictureBoxCanvasElement is changed.
Declaration
public event EventHandler PanChanged
Event Type
|
System.EventHandler
|
ZoomChanged
Occurs when the ZoomFactor has changed.
Declaration
public event EventHandler ZoomChanged
Event Type
|
System.EventHandler
|