BitmapDataExtensions Class

KGy SOFT Drawing Libraries Help
Provides extension methods for the IReadableBitmapData, IWritableBitmapData and IReadWriteBitmapData types.
Inheritance Hierarchy

SystemObject
  KGySoft.Drawing.ImagingBitmapDataExtensions

Namespace:  KGySoft.Drawing.Imaging
Assembly:  KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.2.0
Syntax

public static class BitmapDataExtensions

The BitmapDataExtensions type exposes the following members.

Methods

  NameDescription
Public methodStatic memberAdjustBrightness
Adjusts the brightness of the specified bitmapData.
See the Remarks section for details.
Public methodStatic memberAdjustContrast
Adjusts the contrast of the specified bitmapData.
See the Remarks section for details.
Public methodStatic memberAdjustGamma
Adjusts the gamma correction of the specified bitmapData.
See the Remarks section for details.
Public methodStatic memberClear
Clears the content of the specified bitmapData and fills it with the specified color.
This method is similar to Graphics.Clear except that this one supports any PixelFormat and also dithering.
Public methodStatic memberClip(IReadableBitmapData, Rectangle)
Clips the specified source using the specified clippingRegion. Unlike the Clone methods, this one returns a wrapper, providing access only to the specified region of the original source.
See the Remarks section for details.
Public methodStatic memberClip(IReadWriteBitmapData, Rectangle)
Clips the specified source using the specified clippingRegion. Unlike the Clone methods, this one returns a wrapper, providing access only to the specified region of the original source.
See the Remarks section for details.
Public methodStatic memberClip(IWritableBitmapData, Rectangle)
Clips the specified source using the specified clippingRegion. Unlike the Clone methods, this one returns a wrapper, providing access only to the specified region of the original source.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData)
Gets the clone of the specified source with identical size and pixel format.
Public methodStatic memberClone(IReadableBitmapData, PixelFormat, IDitherer)
Gets the clone of the specified source with identical size and the specified pixelFormat, using an optional ditherer. This method is similar to ConvertPixelFormat(Image, PixelFormat, IQuantizer, IDitherer) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, PixelFormat, Palette)
Gets the clone of the specified source with identical size and the specified pixelFormat and palette. This method is similar to ConvertPixelFormat(Image, PixelFormat, Color, Color, Byte) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, PixelFormat, Color32, Byte)
Gets the clone of the specified source with identical size and the specified pixelFormat and color settings. This method is similar to ConvertPixelFormat(Image, PixelFormat, Color, Color, Byte) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, PixelFormat, IQuantizer, IDitherer)
Gets the clone of the specified source with identical size and the specified pixelFormat, using an optional quantizer and ditherer. This method is similar to ConvertPixelFormat(Image, PixelFormat, IQuantizer, IDitherer) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, Rectangle, PixelFormat, IDitherer)
Gets the clone of the specified portion of source with the specified pixelFormat, using an optional ditherer. This method is similar to ConvertPixelFormat(Image, PixelFormat, IQuantizer, IDitherer) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, Rectangle, PixelFormat, Palette)
Gets the clone of the specified portion of source with the specified pixelFormat and palette. This method is similar to ConvertPixelFormat(Image, PixelFormat, Color, Color, Byte) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, Rectangle, PixelFormat, Color32, Byte)
Gets the clone of the specified portion of source with the specified pixelFormat and color settings. This method is similar to ConvertPixelFormat(Image, PixelFormat, Color, Color, Byte) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberClone(IReadableBitmapData, Rectangle, PixelFormat, IQuantizer, IDitherer)
Gets the clone of the specified portion of source with the specified pixelFormat, using an optional quantizer and ditherer. This method is similar to ConvertPixelFormat(Image, PixelFormat, IQuantizer, IDitherer) but as the result is a managed IReadWriteBitmapData instance every PixelFormat is supported on any platform.
See the Remarks section for details.
Public methodStatic memberCopyTo(IReadableBitmapData, IWritableBitmapData, Point, IDitherer)
Copies the source IReadableBitmapData into the target IWritableBitmapData without scaling and blending. This method works between any pair of source and target PixelFormats and supports quantizing and dithering. To draw a bitmap data into another one with blending use the DrawInto methods instead.
See the Remarks section for details.
Public methodStatic memberCopyTo(IReadableBitmapData, IWritableBitmapData, Point, IQuantizer, IDitherer)
Copies the source IReadableBitmapData into the target IWritableBitmapData without scaling and blending. This method works between any pair of source and target PixelFormats and supports quantizing and dithering. To draw a bitmap data into another one with blending use the DrawInto methods instead.
See the Remarks section for details.
Public methodStatic memberCopyTo(IReadableBitmapData, IWritableBitmapData, Rectangle, Point, IDitherer)
Copies the source IReadableBitmapData into the target IWritableBitmapData without scaling and blending. This method works between any pair of source and target PixelFormats and supports quantizing and dithering. To draw a bitmap data into another one with blending use the DrawInto methods instead.
See the Remarks section for details.
Public methodStatic memberCopyTo(IReadableBitmapData, IWritableBitmapData, Rectangle, Point, IQuantizer, IDitherer)
Copies the source IReadableBitmapData into the target IWritableBitmapData without scaling and blending. This method works between any pair of source and target PixelFormats and supports quantizing and dithering. To draw a bitmap data into another one with blending use the DrawInto methods instead.
See the Remarks section for details.
Public methodStatic memberDither
Quantizes an IReadWriteBitmapData with dithering (reduces the number of colors while trying to preserve details) using the specified quantizer and ditherer.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Point, IDitherer)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method is similar to Graphics.DrawImage methods, except that this one always preserves the source size in pixels, works between any pair of source and target PixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, ScalingMode)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method is similar to Graphics.DrawImage methods, except that this one works between any pair of source and target PixelFormats and supports quantizing. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Point, IQuantizer, IDitherer)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method is similar to Graphics.DrawImage methods, except that this one always preserves the source size in pixels, works between any pair of source and target PixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, IDitherer, ScalingMode)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method is similar to Graphics.DrawImage methods, except that this one works between any pair of source and target PixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Point, IDitherer)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method is similar to Graphics.DrawImage methods, except that this one always preserves the source size in pixels, works between any pair of source and target PixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, ScalingMode)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method is similar to Graphics.DrawImage methods, except that this one works between any pair of source and target PixelFormats and supports quantizing. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, IQuantizer, IDitherer, ScalingMode)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method is similar to Graphics.DrawImage methods, except that this one works between any pair of source and target PixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Point, IQuantizer, IDitherer)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData without scaling, using blending. This method is similar to Graphics.DrawImage methods, except that this one always preserves the source size in pixels, works between any pair of source and target PixelFormats and supports quantizing and dithering. For scaling use the overloads with targetRectangle and ScalingMode parameters. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IDitherer, ScalingMode)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method is similar to Graphics.DrawImage methods, except that this one works between any pair of source and target PixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberDrawInto(IReadableBitmapData, IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode)
Draws the source IReadableBitmapData into the target IReadWriteBitmapData using scaling and blending. This method is similar to Graphics.DrawImage methods, except that this one works between any pair of source and target PixelFormats and supports quantizing and dithering. To copy a bitmap data into another one without blending use the CopyTo methods instead.
See the Remarks section for details.
Public methodStatic memberGetColorCount
Gets the actual number of colors of the specified bitmapData. Colors are counted even for indexed bitmaps.
See the Remarks section for details.
Public methodStatic memberGetColors
Gets the colors used in the specified bitmapData. A limit can be defined in maxColors.
See the Remarks section for details.
Public methodStatic memberInvert
Inverts the colors of the specified bitmapData.
See the Remarks section for details.
Public methodStatic memberMakeGrayscale
Makes this bitmapData grayscale.
See the Remarks section for details.
Public methodStatic memberMakeOpaque
Makes this bitmapData opaque using the specified backColor.
See the Remarks section for details.
Public methodStatic memberMakeTransparent(IReadWriteBitmapData)
If possible, makes the background of this bitmapData transparent, taking the bottom-left pixel as the background color. If the bitmapData does not support transparency, then the pixels that have the same color as the bottom-left pixel will be set to the BackColor of bitmapData.
See the Remarks section for details.
Public methodStatic memberMakeTransparent(IReadWriteBitmapData, Color32)
If possible, makes the background of this bitmapData transparent, using transparentColor as the background color. If the bitmapData does not support transparency, then the pixels that have the same color as transparentColor will be set to the BackColor of bitmapData.
See the Remarks section for details.
Public methodStatic memberQuantize
Quantizes an IReadWriteBitmapData using the specified quantizer (reduces the number of colors).
See the Remarks section for details.
Public methodStatic memberReplaceColor
Replaces every oldColor occurrences to newColor in the specified bitmapData.
See the Remarks section for details.
Public methodStatic memberToBitmap
Converts the specified source to a Bitmap.
See the Remarks section for details.
Public methodStatic memberToGrayscale
Returns a new IReadWriteBitmapData, which is the grayscale version of the specified bitmapData.
See the Remarks section for details.
Public methodStatic memberToTransparent(IReadableBitmapData)
Returns a new IReadWriteBitmapData, which is the clone of the specified bitmapData with transparent background.
See the Remarks section for details.
Public methodStatic memberToTransparent(IReadableBitmapData, Color32)
Returns a new IReadWriteBitmapData, which is the clone of the specified bitmapData with transparent background.
See the Remarks section for details.
Public methodStatic memberTransformColors(IReadWriteBitmapData, FuncColor32, Color32)
Transforms the colors of this bitmapData using the specified transformFunction delegate.
See the Remarks section for details.
Public methodStatic memberTransformColors(IReadWriteBitmapData, FuncColor32, Color32, IDitherer)
Transforms the colors of this bitmapData using the specified transformFunction delegate.
See the Remarks section for details.
Public methodStatic memberTrySetPalette
Tries to the set the specified palette for this IWritableBitmapData.
See the Remarks section for details.
Top
See Also

Reference