New to Telerik UI for ASP.NET AJAX? Start 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
Name | Description |
---|---|
ApplyImageOperations | Applies 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. |
ExtractFileNameFromImageUrl | Extracts the file name from the value of the ImageUrl property. Returns the file name without the extension. |
EnsureToolsFileLoaded | Forces the ToolsFile to be parsed and loaded at any given time. |
GetEditableImage | Gets 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 . |
IsBuiltInCommand | Returns a bool value that indicates whether the command is built-in in the RadImageEditor, or is a custom one. |
LoadToolsFile | Loads ImageEditor tools from the passed XmlDocument. Takes an object of type XmlDocument as an argument. |
RegisterCustomCommand | Registers 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. |
ResetChanges | Clears 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. |
SaveEditableImage | Applies 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
Name | Description |
---|---|
ActiveCommand | Gets the name of the last (active) command executed by the ImageEditor. |
AllowedSavingLocation | Gets 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. |
AlternateText | Gets or sets the alternate text displayed in the edited image when the image is unavailable. |
CanvasMode | Gets or sets a value that indicates whether or not the canvas mode of the ImageEditor will be enabled. |
CurrentImageKey | Gets the unique identifier of the current EditableImage. |
CurrentImageUrl | Gets or sets the location of the currently edited image within the Image editor. |
DescriptionUrl | Gets or sets the location to a detailed description for the edited image. |
EnableResize | Gets or sets a bool value that indicates whether the control can be resized. |
ExternalDialogsPath | Gets 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. |
Height | Gets or sets the height of the RadImageEditor control. |
HttpHandlerUrl | Specifies 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. |
ImageCacheStorageLocation | Specifies 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 |
ImageManager | Configures the ImageEditor's ContentProvider. |
ImageStorageKey | GUID key used to get all the image keys from the CacheProvider, related with the current instance of the ImageEditor control. |
ImageUrl | Gets or sets the location of an image to edit within the image editor. |
Language | Gets or sets a string containing the localization language for the RadImageEditor UI. |
Localization | The Localization property specifies the strings that appear in the runtime user interface of RadImageEditor. |
LocalizationPath | Gets 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. |
LowerZoomBound | Gets 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%. |
ShowAjaxLoadingPanel | Gets or sets a bool value that indicates whether RadAjaxLoadingPanel will be shown over the tools panel. |
Skin | Sets the skin the control will be using |
StatusBarMode | Gets or sets a value that controls the behavior of the RadImageEditor's StatusBar |
ToolBarMode | Gets or sets value that controls the behavior of the Toolbar. The options available are: "Default" and "Docked". |
ToolBarPosition | Gets or sets the position of the Toolbar relative to the edited content (content area). |
Tools | Gets the collection containing RadImageEditor tools. |
ToolsFile | Gets 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 |
ToolsLoadPanelType | The panel type to use for loading the tools dialogs' content. |
UndoLimit | Gets 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. |
UndoStack | The collection of commands that are applied on the client, and need to be applied on the server. |
UpperZoomBound | Gets 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%. |
Width | Gets or sets the width of the RadImageEditor control. |
RadImageEditor Properties For Setting Client-Side Event Handlers
Client-Side Event Handlers
Name | Description |
---|---|
OnClientLoad | The name of the javascript function called when the control loads in the browser. |
OnClientResizeStart | The name of the javascript function called when the resizing is started on the control. |
OnClientResizeEnd | The name of the javascript function called when the resizing on the control ends. |
OnClientCommandExecuting | The 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. |
OnClientDialogLoaded | The name of the javascript function called when a tool widget dialog is loaded from the server. |
OnClientCommandExecuted | The 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. |
OnClientImageChanging | The name of the javascript function called before a change is applied on the image edited. The event can be canceled. |
OnClientImageLoad | The name of the javascript function called when the image in the editor loads in the browser. |
OnClientImageChanged | The name of the javascript function called after a change is applied on the image edited. |
OnClientSaving | The name of the javascript function called before the image is saved on the client or the server. The event can be canceled. |
OnClientSaved | The name of the javascript function called after the image is saved on the client or the server. |
OnClientShortCutHit | The name of the javascript function called, when a given Keyboard ShortCut of the RadImageEditor was hit. The event can be cancelled. |
OnClientToolsDialogClosed | The name of the javascript function called when the tool's panel dialog is closed. |
RadImageEditor EditableImage Methods
Methods
Name | Description |
---|---|
AddText | Adds 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. |
ApplyImageOperations | Applies 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. |
ChangeOpacity | Changes the opacity if the current EditableImage. Takes as arguement the opacity to be set. |
Clone | Creates copy of the current EditableImage. Returnes the cloned EditableImage. |
Crop | Crops a selected area of the current EditableImage. Takes as arguement an instance of the class Rectangle, which determines the cropped zone. |
Dispose | Disposes the current EditableImage. |
EditableImage | Creates 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. |
FixGifColors | Fixes a problem with the Gif file format support in the .NET framework. |
Flip | Flips the current EditableImage to the specified direction. Takes as arguement the direction, to which the EditableImage should be flipped. |
InsertImage | Inserts 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. |
ReplaceImage | Replaces the current System.Drawing.Image object of the EditableImage. Takes as argument the System.Drawing.Image object to replace the existing Image with. |
Resize | Resizes the current EditableImage. It can take either one argument of type Size or two arguments, which will specify whe new width and height. |
Rotate | Rotates the current EditableImage. Takes as arguement the angle for rotating the EditableImage. |
RadImageEditor EditableImage Properties
Properties
Name | Description |
---|---|
Format | Gets the format of the current EditableImage. |
Height | Gets the height of the current EditableImage. |
Image | Gets the Image object of the current EditableImage. |
IsDisposed | Gets a bool value that indicates whether the dispose method of the EditableImage has been called. |
RawFormat | Gets the format of the current EditableImage as an instance of ImageFormat. |
Size | Gets the size of the current EditableImage. |
Width | Gets the width of the current EditableImage. |
RadImageEditor Tool Methods
Methods
Name | Description |
---|---|
ImageEditorTool | Creates 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. |
ImageEditorToolSeparator | Creates a tool separator. |
RadImageEditor Tool Properties
Properties
Name | Description |
---|---|
CommandName | Gets or sets the name of the command fired when the tool is clicked. |
CssClass | Gets or sets the CSS class applied to the ImageEditor tool. |
Enabled | Gets or sets a value indicating whether this ImageEditor tool is enabled. |
ImageUrl | Gets or sets the location of an image (icon) to display in the ImageEditor tool |
IsSeparator | Gets or sets a bool value that indicates whether the tool is a separator. |
IsToggleButton | Gets or sets a value indicating whether the ImageEditor tool can be toggled or not. |
ShortCut | Gets or sets the keyboard shortcut which will invoke the associated RadImageEditor command. |
Text | Gets or sets the text displayed in the tool. |
ToolTip | Gets or sets the ToolTip of the ImageEditor tool. |
RadImageEditor ToolGroup Methods
Methods
Name | Description |
---|---|
Contains | Determines whether the group a tool with the specified name. |
FindTool | Finds the tool with the given name. |
GetAllTools | Gets all tools inside the group. |
ImageEditorToolStrip | Creates an ImageEditor toolstrip with the specified command name. |
LoadTools | Initializes the Tools collection from the ToolsFileContent property of RadImageEditor. |
RadImageEditor ToolGroup Properties
Properties
Name | Description |
---|---|
Tools | Gets the children of the ImageEditorToolGroup. |
RadImageEditor Enumerators
Enumerators
Name | Values |
---|---|
AllowedSavingLocation | Specifies 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. |
FlipDirection | Vertical, Horizontal, Both |
Rotation | Rotate90, Rotate180, Rotate270 |
StatusBarMode | Specifies 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. |
ToolBarMode | Specifies 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. |
ToolBarPosition | Specifies 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. |
CanvasMode | Specifies 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. |
ImageStorage | Specifies 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. |
ToolsLoadPanelTypes | AjaxPanel, XmlHttpPanel |