ImageExtensions Class

Contains custom extension methods to use with Image type.

Definition

Namespace: DevCase.Extensions.ImageExtensions
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[HideModuleNameAttribute]
public sealed class ImageExtensions
Inheritance
Object    ImageExtensions

Methods

ApplyColorMatrix(Image, ColorMatrix) Applies a custom color matrix to an Image.
ApplyColorMatrix(Image, ColorMatrix, GraphicsQualityContainer) Applies a custom color matrix to an Image.
Center(Image, Size, GraphicsQualityContainer) Centers the source Image within the specified canvas size.

The resulting effect is equal than using Center in a PictureBox.

Center(Image, Size, GraphicsQualityContainer, Color) Centers the source Image within the specified canvas size.

The resulting effect is equal than using Center in a PictureBox.

ComputeHashT Computes a hash code for the source Image.
ContainsColor Determines whether an Image contains the specified color.
ConvertToPixelFormat Converts the piel format of the source Image.
Crop(Image, Rectangle) Crops an Image.
Crop(Image, Point, Size) Crops an Image.
Crop(Image, Int32, Int32, Int32, Int32) Crops an Image.
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
Flip Flips an Image.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetPixelInfo For each pixel in the source image, gets the Color, pixel position, and coordinates location respectivelly to the image.
GetPixelInfoAt Gets a PixelInfo instance that contains the Color, pixel position, and coordinates location respectivelly to the image, of the pixel at the specified pixel position.
GetRegion Gets a region from the specified Image.
GetRegionExclude Gets a reversed region from the specified Image.
GetRegionInclude Gets a region from the specified Image.
GetRegionReverse Gets a reversed region from the specified Image.
GetType Gets the Type of the current instance.
(Inherited from Object)
IndexOf(Image, Color) Reports the zero-based pixel index of the first occurrence of the specified Color in this image.
IndexOf(Image, Color, Int32) Reports the zero-based pixel index of the first occurrence of the specified Color in this image.
IndexOf(Image, Color, Int32, Int32) Reports the zero-based pixel index of the first occurrence of the specified Color in this image.
InvertColors(Image) Inverts the colors of an Image.
InvertColors(Image, GraphicsQualityContainer) Inverts the colors of an Image.
ReplaceColor Replaces the specified color in a Image.
Resize(Image, Double, Boolean) Resizes an Image by the given percentage.
Resize(Image, Size, Boolean) Resizes an Image.
Resize(Image, Double, Boolean, GraphicsQualityContainer) Resizes an Image by the given percentage.
Resize(Image, Size, Boolean, GraphicsQualityContainer) Resizes an Image.
SaveAsJPEG Saves the Image to the specified file as JPEG image format.
Scale(Image, Single) Scales an Image.
Scale(Image, Single, GraphicsQualityContainer) Scales an Image.
SetBrightness(Image, Single) Adjusts the brightness of an Image.
SetBrightness(Image, Single, GraphicsQualityContainer) Adjusts the brightness of an Image.
SetContrast(Image, Single) Adjusts the contrast of an Image.
SetContrast(Image, Single, GraphicsQualityContainer) Adjusts the contrast of an Image.
SetGamma(Image, Single) Adjusts the gamma of an Image.
SetGamma(Image, Single, GraphicsQualityContainer) Adjusts the gamma of an Image.
SetOpacity(Image, Single) Sets the opacity of an Image.
SetOpacity(Image, Single, GraphicsQualityContainer) Sets the opacity of an Image.
Stretch Stretches the source Image within the specified canvas size.

The resulting effect is equal than using Stretch for BackgroundImageLayout property.

Tile Tiles the source Image accross the specified canvas size.

The resulting effect is equal than using Tile in a PictureBox.

ToArray Converts an Image to a Byte array.
ToBase64 Converts the source image to a Base64 encoded string.
ToBitmapFrame Converts the source Image to a BitmapFrame.
ToBitmapImage Converts the source Image to a BitmapImage.
ToBitmapSource Converts the source Image to a BitmapSource.
ToBlackAndWhite(Image) Transforms an Image to black and white colors.
ToBlackAndWhite(Image, Single) Transforms an Image to black and white colors.
ToBlackAndWhite(Image, Single, GraphicsQualityContainer) Transforms an Image to black and white colors.
ToGrayscale(Image, GrayscaleLevel) Transforms an Image to grayscale colors.
ToGrayscale(Image, GrayscaleLevel, GraphicsQualityContainer) Transforms an Image to grayscale colors.
ToGridImages(Image, Int32, Int32) Creates a grid from an Image with the specified columns and rows amount, then returns a ListT that contains each Rectangle and Image of the grid.
ToGridImages(Image, Int32, Int32, GraphicsQualityContainer) Creates a grid from an Image with the specified columns and rows amount, then returns a ListT that contains each Rectangle and Image of the grid.
ToGridRectangles Creates a grid from an Image with the specified columns and rows amount, then returns a IEnumerableT that contains each Rectangle of the grid.
ToIcon(Image, Boolean, Color) Converts an Image to a Icon of the same size.
ToIcon(Image, Size, Boolean, Color) Converts an Image to a Icon of the specified size.
ToMemoryStream Converts an Image to a MemoryStream.
ToRectangle Returns a Rectangle with the width and height of the source Image
ToRectangleF Returns a RectangleF with the width and height of the source Image
ToString Returns a string that represents the current object.
(Inherited from Object)
Zoom(Image, Size, GraphicsQualityContainer) Enlarges the source Image within the specified canvas size, preserving aspect ratio.

The resulting effect is equal than using Zoom for BackgroundImageLayout property.

Zoom(Image, Size, GraphicsQualityContainer, Color) Enlarges the source Image within the specified canvas size, preserving aspect ratio.

The resulting effect is equal than using Zoom for BackgroundImageLayout property.

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also