ImageEditor - Upload and Edit Image

*Size limit: 2MB
  • Print Image
  • Save Image
  • Export Image
  • Undo
  • Redo
  • Reset Changes
  • Crop
  • Resize
  • Zoom
    • Zoom
    • Zoom In
    • Zoom Out
  • Opacity
  • Rotate
    • Rotate
    • Rotate Right by 90 deg
    • Rotate Left by 90 deg
  • Flip
    • Flip
    • Flip Vertically
    • Flip Horizontally
  • Add Text
  • Insert Image
  • Brightness/Contrast
    • Brightness/Contrast
    • Hue/Saturation
    • Blur
    • Sharpen
    • Greyscale
    • Sepia
    • Invert Colors (negative)
  • Pencil
    • Pencil
    • Line
    • DrawRectangle
    • DrawCircle
Zoom:100%Size:0x0pxPos.:(-,-)Last Action:None
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

This example demonstrates how to upload an image for editing in the Image Editor by using an Ajax Request in the OnClientFilesUploaded event of RadAsyncUpload. RadImageEditor offers a variety of server-side methods and events that enable you to manipulate an image on the server, not just on the client. You can use the OnImageLoading event to change the image that will be loaded according to some custom logic. This event is fired just before the image is loaded from the file system. The event can be cancelled and the edited image loaded from a custom location. Note that the OnImageLoading event is fired only when the ImageEditor needs to load the initial image.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
  • styles.css
<%@ Page Title="" Language="C#"  AutoEventWireup="true"
CodeFile="DefaultCS.aspx.cs" Inherits="ImageEditor_Examples_UploadImage_DefaultCS" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="../../common/styles.css" rel="stylesheet" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link href="styles.css" rel="stylesheet" />
    <script src="scripts.js" type="text/javascript"></script>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-wide">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false">
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <telerik:AjaxUpdatedControl ControlID="RadImageEditor1" />
                        <telerik:AjaxUpdatedControl ControlID="AsyncUpload1" />
        <div id="dwndWrapper">
            <telerik:RadAsyncUpload RenderMode="Lightweight" ID="AsyncUpload1" runat="server" 
                                    OnClientFilesUploaded="OnClientFilesUploaded" OnFileUploaded="AsyncUpload1_FileUploaded"
                                    MaxFileSize="2097152" AllowedFileExtensions="jpg,png,gif,bmp"
                                    AutoAddFileInputs="false" Localization-Select="Upload Image" />
            <asp:Label ID="Label1" Text="*Size limit: 2MB" runat="server" Style="font-size: 10px;"></asp:Label>
        <telerik:RadImageEditor RenderMode="Lightweight" ID="RadImageEditor1" runat="server" Width="790" Height="450" 
                                ImageUrl="~/ImageEditor/images/waterpool.jpg" OnImageLoading="RadImageEditor1_ImageLoading">
    <script type="text/javascript">
        serverID("ajaxManagerID", "<%= RadAjaxManager1.ClientID %>");

Find Assistance

Help Us Improve

Was this example helpful?