BitmapExtensions Class

Contains custom extension methods to use with Bitmap type.

Definition

Namespace: DevCase.Extensions.BitmapExtensions
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 BitmapExtensions
Inheritance
Object    BitmapExtensions

Methods

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

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

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

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

ComputeHashT Computes a hash code for the source Bitmap.
ConvertToPixelFormat Converts the piel format of the source Bitmap.
Crop(Bitmap, Rectangle) Crops an Bitmap.
Crop(Bitmap, Point, Size) Crops an Bitmap.
Crop(Bitmap, Int32, Int32, Int32, Int32) Crops a Bitmap.
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
Flip Flips a Bitmap.
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 Bitmap.
GetRegionExclude Gets a reversed region from the specified Bitmap.
GetRegionInclude Gets a region from the specified Bitmap.
GetRegionReverse Gets a reversed region from the specified Bitmap.
GetType Gets the Type of the current instance.
(Inherited from Object)
InvertColors(Bitmap) Inverts the colors of an Bitmap.
InvertColors(Bitmap, GraphicsQualityContainer) Inverts the colors of an Bitmap.
ReplaceColor Replaces the specified color in a Bitmap.
Resize(Bitmap, Double, Boolean) Resizes an Bitmap by the given percentage.
Resize(Bitmap, Size, Boolean) Resizes an Bitmap.
Resize(Bitmap, Double, Boolean, GraphicsQualityContainer) Resizes an Bitmap by the given percentage.
Resize(Bitmap, Size, Boolean, GraphicsQualityContainer) Resizes an Bitmap.
SaveAsJPEG Saves the Bitmap to the specified file as JPEG image format.
Scale(Bitmap, Single) Scales an Bitmap.
Scale(Bitmap, Single, GraphicsQualityContainer) Scales an Bitmap.
SetBrightness(Bitmap, Single) Adjusts the brightness of an Bitmap.
SetBrightness(Bitmap, Single, GraphicsQualityContainer) Adjusts the brightness of an Bitmap.
SetContrast(Bitmap, Single) Adjusts the contrast of an Bitmap.
SetContrast(Bitmap, Single, GraphicsQualityContainer) Adjusts the contrast of an Bitmap.
SetGamma(Bitmap, Single) Adjusts the gamma of an Bitmap.
SetGamma(Bitmap, Single, GraphicsQualityContainer) Adjusts the gamma of an Bitmap.
SetOpacity(Bitmap, Single) Sets the opacity of a Bitmap.
SetOpacity(Bitmap, Single, GraphicsQualityContainer) Sets the opacity of a Bitmap.
Stretch Stretches the source Bitmap within the specified canvas size.

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

Tile Tiles the source Bitmap accross the specified canvas size.

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

ToArray Converts an Bitmap to a Byte array.
ToBase64 Converts the source image to a Base64 encoded string.
ToBitmapFrame Converts the source Bitmap to a BitmapFrame.
ToBitmapImage Converts the source Bitmap to a BitmapImage.
ToBitmapSource Converts the source Bitmap to a BitmapSource.
ToBlackAndWhite(Bitmap) Transforms a Bitmap to black and white colors.
ToBlackAndWhite(Bitmap, Single) Transforms a Bitmap to black and white colors.
ToBlackAndWhite(Bitmap, Single, GraphicsQualityContainer) Transforms a Bitmap to black and white colors.
ToGrayscale(Bitmap, GrayscaleLevel) Transforms a Bitmap to grayscale colors.
ToGrayscale(Bitmap, GrayscaleLevel, GraphicsQualityContainer) Transforms a Bitmap to grayscale colors.
ToIcon(Bitmap, Boolean, Color) Converts a Bitmap to a Icon.
ToIcon(Bitmap, Size, Boolean, Color) Converts a Bitmap to a Icon of the specified size.
ToMemoryStream Converts an Bitmap to a MemoryStream.
ToRectangle Returns a Rectangle with the width and height of the source Bitmap.
ToRectangleF Returns a RectangleF with the width and height of the source Bitmap.
ToString Returns a string that represents the current object.
(Inherited from Object)
Zoom(Bitmap, Size, GraphicsQualityContainer) Enlarges the source Bitmap within the specified canvas size, preserving its aspect ratio.

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

Zoom(Bitmap, Size, GraphicsQualityContainer, Color) Enlarges the source Bitmap within the specified canvas size, preserving its 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