ClassRadPictureBox
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
RadPictureBox()
Initializes a new instance of the RadPictureBox class.
Declaration
public 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.
BottomPanel
Gets the bottom panel element. This panel allows adding buttons label and other elements in three collections - left, center and right items.
Declaration
[Browsable(false)]
public PictureBoxHorizontalPanelElement BottomPanel { get; }
Property Value
ContextMenuDropDown
Gets the context menu.
Declaration
[Browsable(false)]
public RadContextMenuDropDown ContextMenuDropDown { get; }
Property Value
ContextMenuEnabled
Gets or sets a value indicating whether to display context menu on right mouse click.
Declaration
[Browsable(false)]
public bool ContextMenuEnabled { get; set; }
Property Value
ContextMenuProperties
Gets the context menu related properties.
Declaration
[Browsable(false)]
public PictureBoxContextMenuProperties ContextMenuProperties { get; }
Property Value
DefaultImage
DefaultSize
Gets the default size of the RadPictureBox when a new instance is initialized.
Declaration
protected override Size DefaultSize { get; }
Property Value
Overrides
DefaultSvgImage
Gets or sets the vector (SVG) image displayed when no main image is specified.
Declaration
public RadSvgImage DefaultSvgImage { get; set; }
Property Value
The default RadSvgImage to display, or null if no default SVG image is set.
Image
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
ImageEditorDialog
Gets or sets the dialog responsible for image editing.
Declaration
[Browsable(false)]
public PictureBoxImageEditorDialog ImageEditorDialog { get; set; }
Property Value
ImageLayout
Specifies how the image is positioned on the control.
Declaration
public RadImageLayout ImageLayout { get; set; }
Property Value
LeftPanel
Gets the left panel element. This panel allows adding buttons label and other elements in three collections - top, center and bottom items.
Declaration
[Browsable(false)]
public PictureBoxVerticalPanelElement LeftPanel { get; }
Property Value
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
PanelOverflowMode
Gets or sets a value indicating how the panels are positioned.
Declaration
public PictureBoxPanelOverflowMode PanelOverflowMode { get; set; }
Property Value
PictureBoxElement
Gets the main element of the picture box control.
Declaration
[Browsable(false)]
public RadPictureBoxElement PictureBoxElement { get; }
Property Value
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
[Browsable(true)]
public bool ReadOnly { get; set; }
Property Value
RightPanel
Gets the right panel element. This panel allows adding buttons label and other elements in three collections - top, center and bottom items.
Declaration
[Browsable(false)]
public PictureBoxVerticalPanelElement RightPanel { get; }
Property Value
ShowBackground
Gets or sets a value indicating whether to display control background(fill).
ShowBorder
Gets or sets a value indicating whether to display control border.
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.
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
The RadSvgImage to display, or null if no SVG image is set.
TopPanel
Gets the top panel element. This panel allows adding buttons label and other elements in three collections - left, center and right items.
Declaration
[Browsable(false)]
public PictureBoxHorizontalPanelElement TopPanel { get; }
Property Value
ZoomProperties
Gets the properties responsible for the zoom operations.
Declaration
[Browsable(false)]
public PictureBoxZoomProperties ZoomProperties { get; }
Property Value
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
parent
The parent RadElement to which child elements will be added.
Overrides
CreatePictureBoxElement()
Creates a new instance of the RadPictureBoxElement class used as main element.
Declaration
protected virtual RadPictureBoxElement CreatePictureBoxElement()
Returns
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
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.
ContextMenuClosing
Occurs when the context menu is closing.
Declaration
public event CancelEventHandler ContextMenuClosing
Event Value
ContextMenuItemClick
Occurs when an item in the context menu is clicked.
Declaration
public event HandledEventHandler ContextMenuItemClick
Event Value
ContextMenuOpened
Occurs when the context menu is opened.
ContextMenuOpening
Occurs when the context menu is opening.
Declaration
public event CancelEventHandler ContextMenuOpening
Event Value
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 Value
ImageEditorOpening
Occurs when the image is about to be edited in the ImageEditorDialog. Cancellable.
Declaration
public event PictureBoxImageEditorOpeningEventHandler ImageEditorOpening
Event Value
ImageLoaded
Occurs when a raster or vector(SVG) image has been loaded by the user.
ImageSaved
Occurs when the displayed image has been saved by the user.
PanChanged
Occurs when the PositionOffset property of PictureBoxCanvasElement is changed.
ZoomChanged
Occurs when the ZoomFactor has changed.