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

Default implementation of the IImageEditorCacheHandler interface that handles HTTP requests for cached images. This handler processes image downloads from various sources including image providers, canvas elements, and the file system.

Definition

Namespace:Telerik.Web.UI.ImageEditor

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class ImageEditorCacheHandler : IHttpHandler

Inheritance: objectImageEditorCacheHandler

Implements: IHttpHandler

Inherited Members object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public ImageEditorCacheHandler()

Properties

Gets or sets the graphics core implementation used for image processing operations.

C#
public virtual IGraphicsCore GraphicsCore { get; set; }
C#
public bool IsReusable { get; }

Implements: IHttpHandler.IsReusable

Methods

Combines a file name from the name and extension provided. If filename is empty, then it uses a default one.

C#
public string CombineFileName(string fileName, string extension)
Parameters:fileNamestring

The name of the file. If empty, a default value will be used.

extensionstring

The file extension

Returns:

string

Combines the name of an editable image using the provided name and image format as extension.

C#
public string CombineImageFileName(EditableImage editableImage, string fileName)
Parameters:editableImageEditableImage

The editable image specifying the file extension

fileNamestring

The name of the image

Returns:

string

Decrypts the specified input string using HMAC-enabled cryptographic services.

C#
public virtual string Decrypt(string input)
Parameters:inputstring

The encrypted string to decrypt.

Returns:

string

The decrypted string.

Encrypts the specified input string using HMAC-enabled cryptographic services.

C#
public virtual string Encrypt(string input)
Parameters:inputstring

The string to encrypt.

Returns:

string

The encrypted string.

Determines whether the specified download key represents a custom download operation.

C#
public virtual bool IsCustomDownloadOperation(string downloadKey)
Parameters:downloadKeystring

The download key to validate.

Returns:

bool

true if this is a custom download operation; otherwise, false.

Determines whether the image was downloaded from a canvas element.

C#
public virtual bool IsDownloadedFromCanvas(string downloadKey)
Parameters:downloadKeystring

The download key to check.

Returns:

bool

true if the image source is a canvas element; otherwise, false.

Determines whether the image was downloaded from an image provider.

C#
public virtual bool IsDownloadedFromImageProvider(string downloadKey)
Parameters:downloadKeystring

The download key to check.

Returns:

bool

true if the image source is an image provider; otherwise, false.

Validates whether the provided download key is properly formatted and encrypted.

C#
public virtual bool IsValidDownloadKey(string downloadKey)
Parameters:downloadKeystring

The encrypted download key to validate.

Returns:

bool

true if the download key is valid; otherwise, false.

Outputs an editable image to the HTTP response for viewing in the browser.

C#
public virtual void OutputImage(EditableImage editableImage, HttpContext context)
Parameters:editableImageEditableImage

The editable image to output.

contextHttpContext

The HTTP context for the response.

Outputs an editable image to the HTTP response as a file download.

C#
public virtual void OutputImageForDownload(EditableImage editableImage, HttpContext context, string fileName)
Parameters:editableImageEditableImage

The editable image to download.

contextHttpContext

The HTTP context for the response.

fileNamestring

The file name for the download.

Outputs an editable image with a specific file extension, converting the format if necessary.

C#
public void OutputImageWithExtension(EditableImage editableImage, HttpContext context, string fileName, string customExt)
Parameters:editableImageEditableImage

The editable image to output.

contextHttpContext

The HTTP context for the response.

fileNamestring

The desired file name.

customExtstring

The desired file extension.

Processes HTTP requests for image downloads, handling authentication and routing to appropriate download methods.

C#
public void ProcessRequest(HttpContext context)
Parameters:contextHttpContext

The HTTP context for the current request.

Implements: IHttpHandler.ProcessRequest(HttpContext)

Sends an editable image to the HTTP response, either for display or download.

C#
public virtual void SendImage(EditableImage editableImage, HttpContext context, string downloadKey, string fileName)
Parameters:editableImageEditableImage

The editable image to send.

contextHttpContext

The HTTP context for the response.

downloadKeystring

The download key indicating the operation type.

fileNamestring

The file name to use for downloads.

Sends a canvas-generated image (base64 encoded) to the HTTP response.

C#
public virtual void SendImageCanvas(string base64String, HttpContext context, string downloadKey, string fileName, string mimeType)
Parameters:base64Stringstring

The base64 encoded image data.

contextHttpContext

The HTTP context for the response.

downloadKeystring

The download key indicating the operation type.

fileNamestring

The file name to use for downloads.

mimeTypestring

The MIME type of the image.

Sets content-disposition header to the HttpResponse using the provided filename.

C#
public virtual void SetHttpHeaderFileName(HttpContext context, string fileName)
Parameters:contextHttpContext

The current HttpContext

fileNamestring

The filename to use