Telerik Product and Version
|
|
Supported Browsers and Platforms
|
All browsers supported by UI for ASP.NET AJAX
|
Components/Widgets used (JS frameworks, etc.)
|
|
PROJECT DESCRIPTION
The idea behind this code library is to demonstrate a possible implementation for integrating custom, predefined effects in
RadImageEditor, with a preview of each effect in a
RadWindow, allowing the user to easily decide which effect to apply.
In the attached project, a simple
Image Processing Library (
BinaryImageLibrary) is used, where 8 predefined effects are available.
Implementation
For this setup we are going to use
RadImageEditor and
RadWindow (where the effect previews will be rendered):
First, we are going to include an item in the
RadImageEditor tools, so we can open manually the
RadWindow:
The next step is to create
RadBinaryImage controls in Panel control placed in the
RadWindow. This is done automatically by the
AddBinaryImageControls(System.Drawing.Image) method, which is called within the RadImageEditor's
OnPreRender event with the current image in the editor as an argument:
When the
RadBinaryImage controls are generated, an event handler for the client-side click event is attached with effect's name as an argument for the
fireCommand() function, which fires custom command through the client-side API of the RadImageEditor:
Finally, within the server-side
OnImageEditing event of the editor, the effect name is retrieved from the arguments and is used for applying the effect from the Image Processing Library's predefined effects:
BinaryImageLibrary
The attached library exposes simple functionality for editing binary images,
System.Drawing.Color objects and methods for converting between different image data formats.
The source code of the library is included in the attached solution, where help document is also available in the
BinaryImageLibrary folder (
documentation.chm).
Final Notes
In order to run the attached solution you will have to add
Telerik.Web.UI and
Telerik.Web.Skins DLLs in the Bin folder of the project.