New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Server-side Programming Overview

This article lists the server-side API of the RadImageEditor control and its related classes. It contains the following sections:

RadImageEditor Public Methods

Methods

NameDescription
ApplyImageOperationsApplies the IImageOperation(s) to the current EditableImage in the order they appear in the operations collection. Takes a collection of IImageOperation(s) to apply as an argument. Can optionally take the EditableImage to apply the operations to. Returns the modified EditableImage object.
ExtractFileNameFromImageUrlExtracts the file name from the value of the ImageUrl property. Returns the file name without the extension.
EnsureToolsFileLoadedForces the ToolsFile to be parsed and loaded at any given time.
GetEditableImageGets a reference to the Telerik.Web.UI.ImageEditor. EditableImage that is currently associated with the ImageEditor control. Returns the associated Telerik.Web.UI.ImageEditor. EditableImage .
IsBuiltInCommandReturns a bool value that indicates whether the command is built-in in the RadImageEditor, or is a custom one.
LoadToolsFileLoads ImageEditor tools from the passed XmlDocument. Takes an object of type XmlDocument as an argument.
RegisterCustomCommandRegisters a custom command in case it is missing as a button from the toolbar. The name of the command as a parameter (string). This method should be called before PreRender.
ResetChangesClears all the changes currently applied to the image, and restores the original image. This method should be invoked before PreRender so that the control can request the original image.
SaveEditableImageApplies the current pending changes on the current RadImageEditor's EditableImage or on a specific EditableImage, saves the EditableImage using the ContentProvider's SaveImage method, and invokes the ImageSaving event. Takes as arguments the name to use if the image is saved on the FileSystem (Use string and leave empty if you want to keep the existing name) and a bool value indicating whether the existing image in the ContentProvider should be overwritten. Can optionally take the EditableImage to save as first argument. Returns a string message that indicates whether the saving was successful. Empty string means the saving was successful.

RadImageEditor Public Properties

Properties

NameDescription
ActiveCommandGets the name of the last (active) command executed by the ImageEditor.
AllowedSavingLocationGets or sets a value that indicates where the user is allowed to save the image. The options available are: "Client", "Server" and "ClientAndServer". The default is ClientAndServer.
AlternateTextGets or sets the alternate text displayed in the edited image when the image is unavailable.
CanvasModeGets or sets a value that indicates whether or not the canvas mode of the ImageEditor will be enabled.
CurrentImageKeyGets the unique identifier of the current EditableImage.
CurrentImageUrlGets or sets the location of the currently edited image within the Image editor.
DescriptionUrlGets or sets the location to a detailed description for the edited image.
EnableResizeGets or sets a bool value that indicates whether the control can be resized.
ExternalDialogsPathGets or sets a value indicating where the image editor will look for its dialogs.The required argument is a relative path to the dialogs location, for example: "~/controls/RadImageEditorDialogs/". If specified, the ExternalDialogsPath property allows the image editordialogs to be customized and loaded from normal ASCX files.
HeightGets or sets the height of the RadImageEditor control.
HttpHandlerUrlSpecifies the URL of the HTTPHandler that serves the cached image. The HTTPHandler should either be registered in the application configuration file, or a file with the specified name should exist at the location, which HttpHandlerUrl points to. If a file is to serve the files, it should inherit the class Telerik.Web.UI.WebResource.
ImageCacheStorageLocationSpecifies where the cached imaged from the operation will be stored. When the image is stored in the session the HttpHandler definition (in the web.config file) must be changed from Telerik.Web.UI.WebResource to Telerik.Web.UI.WebResourceSession so that the image can be retrieved from the Session
ImageManagerConfigures the ImageEditor's ContentProvider.
ImageStorageKeyGUID key used to get all the image keys from the CacheProvider, related with the current instance of the ImageEditor control.
ImageUrlGets or sets the location of an image to edit within the image editor.
LanguageGets or sets a string containing the localization language for the RadImageEditor UI.
LocalizationThe Localization property specifies the strings that appear in the runtime user interface of RadImageEditor.
LocalizationPathGets or sets a value indicating where the image editor will look for its .resx localization files. By default these files should be in the App_GlobalResources folder. However, if you cannot put the resource files in the default location or .resx files compilation is disabled for some reason (e.g. in a DotNetNuke environment), this property should be set to the location of the resource files. The required argument is a relative path to the dialogs location. For example: "~/controls/RadEditorResources/". If specified, the LocalizationPath property will allow you to load the image editor localization files from any location in the web application.
LowerZoomBoundGets or sets the lower limit of the zoom level. This is the lowest percentage value up to which the user can zoom out the image in the RadImageEditor.The default value is 25%.
ShowAjaxLoadingPanelGets or sets a bool value that indicates whether RadAjaxLoadingPanel will be shown over the tools panel.
SkinSets the skin the control will be using
StatusBarModeGets or sets a value that controls the behavior of the RadImageEditor's StatusBar
ToolBarModeGets or sets value that controls the behavior of the Toolbar. The options available are: "Default" and "Docked".
ToolBarPositionGets or sets the position of the Toolbar relative to the edited content (content area).
ToolsGets the collection containing RadImageEditor tools.
ToolsFileGets or sets a string containing the path to the XML toolbar configuration file. Use "~" (tilde) as a substitution of the web-application's root directory. You can also provide this property with an absolute URL which returns a valid XML toolbar configuration file, e.g., http://MyServer/MyApplication/Tools/MyToolsFile.aspx
ToolsLoadPanelTypeThe panel type to use for loading the tools dialogs' content.
UndoLimitGets or sets the maximal number of operations that will be stored in the Undo stack. Zero (0) is the default value, meaning there is no limit on the number of operations stored.
UndoStackThe collection of commands that are applied on the client, and need to be applied on the server.
UpperZoomBoundGets or sets the upper limit of the zoom level. This is the highest percentage value up to which the user can zoom in the image in the RadImageEditor. The default value is 400%.
WidthGets or sets the width of the RadImageEditor control.

RadImageEditor Properties For Setting Client-Side Event Handlers

Client-Side Event Handlers

NameDescription
OnClientLoadThe name of the javascript function called when the control loads in the browser.
OnClientResizeStartThe name of the javascript function called when the resizing is started on the control.
OnClientResizeEndThe name of the javascript function called when the resizing on the control ends.
OnClientCommandExecutingThe name of the javascript function called when a command is firing on the RadImageEditor. This event is triggered when the ImageEditor's ToolBar buttons are clicked or the RadImageEditor.fire(commandName) method is invoked. The event can be canceled.
OnClientDialogLoadedThe name of the javascript function called when a tool widget dialog is loaded from the server.
OnClientCommandExecutedThe name of the javascript function called when a command is fired on the RadImageEditor. This event is triggered when the ImageEditor's ToolBar buttons are clicked or the RadImageEditor.fire(commandName) method is invoked.
OnClientImageChangingThe name of the javascript function called before a change is applied on the image edited. The event can be canceled.
OnClientImageLoadThe name of the javascript function called when the image in the editor loads in the browser.
OnClientImageChangedThe name of the javascript function called after a change is applied on the image edited.
OnClientSavingThe name of the javascript function called before the image is saved on the client or the server. The event can be canceled.
OnClientSavedThe name of the javascript function called after the image is saved on the client or the server.
OnClientShortCutHitThe name of the javascript function called, when a given Keyboard ShortCut of the RadImageEditor was hit. The event can be cancelled.
OnClientToolsDialogClosedThe name of the javascript function called when the tool's panel dialog is closed.

RadImageEditor EditableImage Methods

Methods

NameDescription
AddTextAdds text to a specific position in the current EditableImage. Takes as arguements the point, in which the text should be inserted, and the text itself.
ApplyImageOperationsApplies the IImageOperation(s) to the current image in the order they appear in the operations collection. Takes as argument the Collection of IImageOperation(s) to apply.
ChangeOpacityChanges the opacity if the current EditableImage. Takes as arguement the opacity to be set.
CloneCreates copy of the current EditableImage. Returnes the cloned EditableImage.
CropCrops a selected area of the current EditableImage. Takes as arguement an instance of the class Rectangle, which determines the cropped zone.
DisposeDisposes the current EditableImage.
EditableImageCreates an EditableImage. Takes as arguments any of the following variants: A stream, containing the image data; A path to the specific image; An object of type System.Drawing.Image; An object of type System.Drawing.Image and an object, implementing the IGraphicsCore interface.
FixGifColorsFixes a problem with the Gif file format support in the .NET framework.
FlipFlips the current EditableImage to the specified direction. Takes as arguement the direction, to which the EditableImage should be flipped.
InsertImageInserts an image in a specific position in the current EditableImage. Takes as arguements the point, in which the image should be placed, and the image itself.
ReplaceImageReplaces the current System.Drawing.Image object of the EditableImage. Takes as argument the System.Drawing.Image object to replace the existing Image with.
ResizeResizes the current EditableImage. It can take either one argument of type Size or two arguments, which will specify whe new width and height.
RotateRotates the current EditableImage. Takes as arguement the angle for rotating the EditableImage.

RadImageEditor EditableImage Properties

Properties

NameDescription
FormatGets the format of the current EditableImage.
HeightGets the height of the current EditableImage.
ImageGets the Image object of the current EditableImage.
IsDisposedGets a bool value that indicates whether the dispose method of the EditableImage has been called.
RawFormatGets the format of the current EditableImage as an instance of ImageFormat.
SizeGets the size of the current EditableImage.
WidthGets the width of the current EditableImage.

RadImageEditor Tool Methods

Methods

NameDescription
ImageEditorToolCreates an ImageEditor tool with or without a specified command name. Can optionally take as arguments the CommandName of the tool and the ShortCut of the tool.
ImageEditorToolSeparatorCreates a tool separator.

RadImageEditor Tool Properties

Properties

NameDescription
CommandNameGets or sets the name of the command fired when the tool is clicked.
CssClassGets or sets the CSS class applied to the ImageEditor tool.
EnabledGets or sets a value indicating whether this ImageEditor tool is enabled.
ImageUrlGets or sets the location of an image (icon) to display in the ImageEditor tool
IsSeparatorGets or sets a bool value that indicates whether the tool is a separator.
IsToggleButtonGets or sets a value indicating whether the ImageEditor tool can be toggled or not.
ShortCutGets or sets the keyboard shortcut which will invoke the associated RadImageEditor command.
TextGets or sets the text displayed in the tool.
ToolTipGets or sets the ToolTip of the ImageEditor tool.

RadImageEditor ToolGroup Methods

Methods

NameDescription
ContainsDetermines whether the group a tool with the specified name.
FindToolFinds the tool with the given name.
GetAllToolsGets all tools inside the group.
ImageEditorToolStripCreates an ImageEditor toolstrip with the specified command name.
LoadToolsInitializes the Tools collection from the ToolsFileContent property of RadImageEditor.

RadImageEditor ToolGroup Properties

Properties

NameDescription
ToolsGets the children of the ImageEditorToolGroup.

RadImageEditor Enumerators

Enumerators

NameValues
AllowedSavingLocationSpecifies where the end user can save the edited image: ClientAndServer - The user can save the image on the client and server machine; Client - The user can save image on the client only; Server - The user can save image on the server only.
FlipDirectionVertical, Horizontal, Both
RotationRotate90, Rotate180, Rotate270
StatusBarModeSpecifies the possible values for the StatusBarMode property of the RadImageEditor control: Bottom - The StatusBar is rendered below the editable area of the ImageEditor; Top - The StatusBar is rendered above the editable area of the ImageEditor and below the ToolBar; Hidden - The StatusBar is not rendered at all.
ToolBarModeSpecifies the Toolbar behavior of the RadImageEditor control: Default - The Toolbar is attached to the ImageEditor control. In this mode the Toolbar is static and can't be moved; Docked - The Toolbar is rendered within a dock and can be docked into one of the 4(four) zones available, or left undocked anywhere on the page.
ToolBarPositionSpecifies the position of the Toolbar relative to the edited content (content area): Top - The Toolbar is rendered above the content area; Right - The Toolbar is rendered to the right of the content area; Bottom - The Toolbar is rendered below the content area; Left - The Toolbar is rendered to the left of the content area.
CanvasModeSpecifies the options for enabling the canvas mode (using HTML5 canvas element for editing images) in the RadImageEditor control: Automatic - The RadImageEditor enables the canvas mode if the client browser supports the HTML5 canvas element, and doesn't enable the canvas mode if the canvas element is not supported; Yes - The canvas mode is always enabled no matter if the browser does not support the HTML5 canvas element; No - The canvas mode is disabled.
ImageStorageSpecifies the locations where a Telerik.Web.UI.RadImageEditor instance can store its intermediary EditableImage objects, resulting from server operations: Cache - The EditableImage objects are stored in the System.Web.Caching.Cache of the current application; Session - The EditableImage objects are stored in the System.Web.SessionState.HttpSessionState of the current HTTP Request; FileSystem - The EditableImage objects are stored in the WebServer's file system.
ToolsLoadPanelTypesAjaxPanel, XmlHttpPanel