New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Flip Image

  • Flip
  • Flip Vertically
  • Flip Horizontally

This example demonstrates how to mirror your image vertically or horizontally. There are four FlipDirections available:

  • FlipDirection.None (default) - the image is not flipped.
  • FlipDirection.Vertical - the image is flipped vertically. The result after the operation is a mirrored image symmetrical to the original, with respect to the horizontal axis.
  • FlipDirection.Horizontal - the image is flipped horizontally. The result after the operation is a mirrored image symmetrical to the original, with respect to the vertical axis.
  • FlipDirection.Both - the image is flipped horizontally and vertically at the same time. The resulting image is a mirrored copy, symmetrical to the original, with respect to both the horizontal and vertical axes. The same effect is achieved by rotating the image 180 degrees.

The flip related tools can be easily shown on the RadImageEditor's ToolBar by creating ImageEditorTool(s) with the following command names:

  • CommandName="Flip" - This command opens the "Flip" tool dialog from which the image can be mirrored in the desired direction.
  • CommandName="FlipVertical" - This tool directly flips the image vertically. If the image is already flipped it will reverse the mirror operation.
  • CommandName="FlipHorizontal" - This command directly flips the image horizontally. If the image is already flipped it will reverse the flip effect.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.ImageEditor.Flip.DefaultCS"CodeFile="DefaultCS.aspx.cs"  %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<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" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-thin">
        <telerik:RadImageEditor RenderMode="Lightweight" ID="RadImageEditor1" runat="server" ImageUrl="~/ImageEditor/images/11.jpg" Width="285px" Height="465px" StatusBarMode="Hidden">
            <Tools>
                <telerik:ImageEditorToolGroup>
                    <telerik:ImageEditorTool CommandName="Flip" ToolTip="Flip Image" IsToggleButton="true"></telerik:ImageEditorTool>
                    <telerik:ImageEditorToolSeparator></telerik:ImageEditorToolSeparator>
                    <telerik:ImageEditorTool CommandName="FlipVertical" ToolTip="Flip Image Vertically"></telerik:ImageEditorTool>
                    <telerik:ImageEditorTool CommandName="FlipHorizontal" ToolTip="Flip Image Horizontally"></telerik:ImageEditorTool>
                </telerik:ImageEditorToolGroup>
            </Tools>
        </telerik:RadImageEditor>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance