RadPictureBox
A control that displays raster or vector images with advanced features including zooming, panning, and image editing capabilities.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Editors")]
[Docking(DockingBehavior.Ask)]
public class RadPictureBox : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadPictureBox...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadPictureBox class.
public RadPictureBox()
Properties
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.
public bool AllowPanelAnimations { get; set; }
Gets the bottom panel element. This panel allows adding buttons label and other elements in three collections - left, center and right items.
[Browsable(false)]
public PictureBoxHorizontalPanelElement BottomPanel { get; }
Gets the context menu.
[Browsable(false)]
public RadContextMenuDropDown ContextMenuDropDown { get; }
Gets or sets a value indicating whether to display context menu on right mouse click.
[Browsable(false)]
public bool ContextMenuEnabled { get; set; }
Gets the context menu related properties.
[Browsable(false)]
public PictureBoxContextMenuProperties ContextMenuProperties { get; }
Gets the default size of the RadPictureBox when a new instance is initialized.
protected override Size DefaultSize { get; }
Overrides:
Gets or sets the vector (SVG) image displayed when no main image is specified.
public RadSvgImage DefaultSvgImage { get; set; }
The default RadSvgImage to display, or null if no default SVG image is set.
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.
public ContentAlignment ImageAlignment { get; set; }
Gets or sets the dialog responsible for image editing.
[Browsable(false)]
public PictureBoxImageEditorDialog ImageEditorDialog { get; set; }
Specifies how the image is positioned on the control.
public RadImageLayout ImageLayout { get; set; }
Gets the left panel element. This panel allows adding buttons label and other elements in three collections - top, center and bottom items.
[Browsable(false)]
public PictureBoxVerticalPanelElement LeftPanel { get; }
Gets or sets a value indicating how the panels are displayed. The possible options are: always or on mouse hover.
public PictureBoxPanelDisplayMode PanelDisplayMode { get; set; }
Gets or sets a value indicating how the panels are positioned.
public PictureBoxPanelOverflowMode PanelOverflowMode { get; set; }
Gets the main element of the picture box control.
[Browsable(false)]
public RadPictureBoxElement PictureBoxElement { get; }
The RadPictureBoxElement that contains the picture box functionality.
Determines if users can only view the image with no interaction: zoom and context menu are not available when read only is true.
[Browsable(true)]
public bool ReadOnly { get; set; }
Gets the right panel element. This panel allows adding buttons label and other elements in three collections - top, center and bottom items.
[Browsable(false)]
public PictureBoxVerticalPanelElement RightPanel { get; }
Gets or sets a value indicating whether to display control background(fill).
public bool ShowBackground { get; set; }
Gets or sets a value indicating whether to display control border.
public bool ShowBorder { get; set; }
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.
public bool ShowScrollBars { get; set; }
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.
public RadSvgImage SvgImage { get; set; }
The RadSvgImage to display, or null if no SVG image is set.
Gets the top panel element. This panel allows adding buttons label and other elements in three collections - left, center and right items.
[Browsable(false)]
public PictureBoxHorizontalPanelElement TopPanel { get; }
Gets the properties responsible for the zoom operations.
[Browsable(false)]
public PictureBoxZoomProperties ZoomProperties { get; }
Methods
Removes the image and/or svg image.
public void ClearImage()
Copies the displayed image into the clipboard.
public void CopyImage()
Creates the child elements by instantiating and adding the main picture box element.
protected override void CreateChildItems(RadElement parent)
The parent RadElement to which child elements will be added.
Overrides:
Creates a new instance of the RadPictureBoxElement class used as main element.
protected virtual RadPictureBoxElement CreatePictureBoxElement()
A new instance of RadPictureBoxElement.
Copies the displayed image into the clipboard and clears the displayed image.
public void CutImage()
Opens an OpenFileDialog which allows the user to choose an image.
public void LoadImage()
Handles the Load event by enabling gesture support for pan and zoom operations.
protected override void OnLoad(Size desiredSize)
The desired size for the control.
Overrides:
Pastes an image from the clipboard.
public void PasteImage()
Opens a SaveFileDialog which allows the user to save the displayed image.
public void SaveImage()
Events
Occurs when the context menu is closed.
public event EventHandler ContextMenuClosed
Occurs when the context menu is closing.
public event CancelEventHandler ContextMenuClosing
Occurs when an item in the context menu is clicked.
public event HandledEventHandler ContextMenuItemClick
Occurs when the context menu is opened.
public event EventHandler ContextMenuOpened
Occurs when the context menu is opening.
public event CancelEventHandler ContextMenuOpening
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.
public event PictureBoxImageEditedEventHandler ImageEdited
Occurs when the image is about to be edited in the ImageEditorDialog. Cancellable.
public event PictureBoxImageEditorOpeningEventHandler ImageEditorOpening
Occurs when a raster or vector(SVG) image has been loaded by the user.
public event EventHandler ImageLoaded
Occurs when the displayed image has been saved by the user.
public event EventHandler ImageSaved
Occurs when the PositionOffset property of PictureBoxCanvasElement is changed.
public event EventHandler PanChanged
Occurs when the ZoomFactor has changed.
public event EventHandler ZoomChanged