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

A straight-forward implementation of the IGraphicsCore using GDI+

Definition

Namespace:Telerik.Web.UI.ImageEditor

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class GDIGraphicsCore : IGraphicsCore

Inheritance: objectGDIGraphicsCore

Implements: IGraphicsCore

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

Constructors

C#
public GDIGraphicsCore()

Methods

Adds text to the image on the provided position.

C#
public virtual Image AddText(Image original, Point position, ImageText text)
Parameters:originalImage

The original image being the base for the operation

positionPoint

The top/left position relative to the original image.

textImageText

The definition of the test to insert, including the content itself

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.AddText(Image, Point, ImageText)

Defines the changes of the pixel opacity of the provided Image

C#
public virtual Image ChangeOpacity(Image original, double opacity)
Parameters:originalImage

The original image being the base for the operation

opacitydouble

The level of opacity. Should be in the range [0-1].

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.ChangeOpacity(Image, double)

Converts the image to the specified format. This change may degrade the quality of the image.

C#
public virtual Image ConvertTo(Image original, EditableFormat format)
Parameters:originalImage

The original image being the base for the operation

formatEditableFormat

The format of the resultant image

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.ConvertTo(Image, EditableFormat)

Crops the provided image using the specified rectangular box

C#
public virtual Image Crop(Image original, Rectangle rectangle)
Parameters:originalImage

The original image being the base for the operation

rectangleRectangle

The bounding box specifying the cropping area

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.Crop(Image, Rectangle)

Flips the image content in the specified direction

C#
public virtual Image Flip(Image original, FlipDirection direction)
Parameters:originalImage

The original image being the base for the operation

directionFlipDirection

The direction of the flip change.

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.Flip(Image, FlipDirection)

Insert another image within the original image at the specified location.

C#
public virtual Image InsertImage(Image original, Point position, Image imageToInsert)
Parameters:originalImage

The original image being the base for the operation

positionPoint

The top/left coordinates relative to the original image.

imageToInsertImage

The image that should be inserted in the original image

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.InsertImage(Image, Point, Image)

Resize the image using a specific interpolation mode.

C#
public virtual Image Resize(Image originalImg, Size newSize, InterpolationMode intMode)
Parameters:originalImgImage

The original image to resize.

newSizeSize

The new image size.

intModeInterpolationMode

The interpolation mode to use. All modes except NearestNeighbor will cause a small loss (1-2 px) of image data around the edges of the original image.

Returns:

Image

The resized image. If the new size is identical to the original size, then the original image is returned.

Resizes the original image by shrinking or expanding it by the provided dimensions

C#
public virtual Image Resize(Image original, Size size)
Parameters:originalImage

The original image being the base for the operation

sizeSize

The new dimensions of the image

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.Resize(Image, Size)

Rotates the image using the enumerated rotation. Currently only rectangular angles' are supported - 90°, 180°, 270°

C#
public virtual Image Rotate(Image original, Rotation rotate)
Parameters:originalImage

The original image being the base for the operation

rotateRotation

The rotation direction for the rotation method

Returns:

Image

The resultant image of the applied graphics method

Implements: IGraphicsCore.Rotate(Image, Rotation)