Click or drag to resize
ImageHelper Class
Class providing methods for image processing.
Inheritance Hierarchy
SystemObject
  CMS.HelpersImageHelper

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 9.0.0
Syntax
C#
public class ImageHelper

The ImageHelper type exposes the following members.

Constructors
Fields
  NameDescription
Public fieldStatic memberAUTOSIZE
Used when resizing image. (Old dimensions: x = 10, y = 20; Resizing: x = AUTOSIZE; y = 10, New dimensions: x = 5, y = 10).
Top
Properties
  NameDescription
Public propertyStatic memberDefaultCompositingMode
Default composition mode is set to SourceCopy.
Public propertyStatic memberDefaultCompositingQuality
Default composing quality is set to HighQuality.
Public propertyStatic memberDefaultInterpolationMode
Default mode is set to HighQualityBicubic.
Public propertyStatic memberDefaultPixelOffsetMode
Default offset mode is set to HighQuality.
Public propertyStatic memberDefaultQuality
Default quality to be used when an image is being re-sized. (Default quality is set to 85% by default).
Public propertyStatic memberDefaultSmoothingMode
Default smoothing mode is set to HighQuality.
Public propertyStatic memberDefaultWrapMode
Default mode is set to TileFlipXY.
Public propertyImageData
Returns image data.
Public propertyStatic memberImageExtensions
Image extensions supported by the system
Public propertyImageHeight
Image height.
Public propertyImageWidth
Image width.
Public propertyStatic memberJPEGEncoder
JPEG image encoder.
Public propertyLastError
Last processing error.
Public propertySourceData
Source data for the image.
Public propertyStatic memberUseFixedEnsureImageDimensions
Gets value that indicates if use of new image resizing is enabled.
Public propertyStatic memberUseGDIForResize
Indicates if GDI resizing will be used for resizing indexed images.
Top
Methods
  NameDescription
Public methodCanResizeImage
Indicates if current image can be resized to the specified dimensions.
Public methodEnsureImageDimensions(Int32, Int32, Int32)
Returns new image dimensions (int[2]: 0 - width, 1 - height) .
Public methodStatic memberEnsureImageDimensions(Int32, Int32, Int32, Int32, Int32)
Computes new image dimensions according to the specified parameters, and returns it.
Public methodStatic memberGetAutoResizeDimensions
Gets dimensions from settings into width, height and max side size parameters.
Public methodStatic memberGetAutoResizeToHeight
Returns HEIGHT the images should be automatically resized to. Value is returned from the site settings.
Public methodStatic memberGetAutoResizeToMaxSideSize
Returns MAX SIDE SIZE the images should be automatically resized to. Value is returned from the site settings.
Public methodStatic memberGetAutoResizeToWidth
Returns WIDTH the images should be automatically resized to. Value is returned from the site settings.
Public methodStatic memberGetBytes
Gets the binary data for the given image
Public methodGetConvertedImage
Transforms image to different format.
Public methodGetConvertedImageData
Transforms image to different format.
Public methodGetFlippedImage
Flips image.
Public methodGetFlippedImageData
Flips image.
Public methodGetGrayscaledImage
Transforms image to grayscale.
Public methodGetGrayscaledImageData
Transforms image to grayscale.
Public methodGetImage
Gets the image based on the file name.
Public methodStatic memberGetImageThumbnailFileName
Returns image thumbnail file name.
Public methodGetImageWithWatermarkData
Gets the image.
Public methodStatic memberGetPositionEnum
Gets the enumeration of the given position string.
Public methodStatic memberGetQRCodeUrl(String, Int32)
Gets the URL for the given QR code
Public methodStatic memberGetQRCodeUrl(String, Int32, String, Int32, String, Int32, String, String)
Gets the URL for the given QR code
Public methodGetResizedImage(Int32)
Returns resized image according to max side size.
Public methodGetResizedImage(Int32, Int32)
Returns resized image.
Public methodGetResizedImageData(Int32, Int32)
Returns resized image as the data array. For quality is used DefaultQuality.
Public methodGetResizedImageData(Int32, Int32, Int32)
Returns resized image as the data array.
Public methodStatic memberGetResizedImageData(HttpPostedFile, Int32, Int32, Int32)
If posted file is image, resizes it to the required dimensions if possible and returns resized data. If it is not image, original data are returned.
Public methodStatic memberGetResizedImageData(Byte, String, Int32, Int32, Int32)
If posted file is image, resizes it to the required dimensions if possible and returns resized data. If it is not image, original data are returned.
Public methodStatic memberGetResizeEnum
Returns image resize enumeration for given string.
Public methodGetRotatedImage
Rotates image by specified angle.
Public methodGetRotatedImageData
Rotates image by specified angle.
Public methodGetTrimmedImage(Int32, Int32, ImageHelperImageTrimAreaEnum)
Trim image by specified area.
Public methodGetTrimmedImage(Int32, Int32, Int32, Int32)
Trim image by specified area.
Public methodGetTrimmedImageData(Int32, Int32, ImageHelperImageTrimAreaEnum)
Trim image by specified area.
Public methodGetTrimmedImageData(Int32, Int32, Int32, Int32)
Crop image by specified area.
Public methodImageFormatToString
Gets image format.
Public methodImageToBytes(Image)
Converts Image to byte array.
Public methodImageToBytes(Image, Int32)
Converts Image to byte array.
Public methodStatic memberIsHtml
Determines whether it is a html/htm extension or not.
Public methodStatic memberIsImage
Determines whether it is an image extension or not. Accepts extensions in both formats ".gif", and "gif"
Public methodStatic memberIsMimeImage
Determines whether image is an image depending on mimetype.
Public methodStatic memberIsSupportedByImageEditor
Checks if image format is supported by Image Editor.
Public methodLoadImage
Load image data.
Public methodStatic memberStringToImageFormat
Gets string name of image format.
Public methodStatic memberUnifyFileExtension
Unifies file extensions.
Top
See Also