IReadWriteBitmapData Interface

KGy SOFT Drawing Libraries Help
Represents an IBitmapData instance with read/write access. To create an instance use the BitmapDataFactory class or the BitmapExtensions.GetReadWriteBitmapData extension method.
See the Remarks section of the GetReadWriteBitmapData method for details and examples.

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

public interface IReadWriteBitmapData : IReadableBitmapData, 
	IBitmapData, IDisposable, IWritableBitmapData

The IReadWriteBitmapData type exposes the following members.

Properties

  NameDescription
Public propertyAlphaThreshold
If this IBitmapData represents a bitmap with single bit alpha or with a palette that has a transparent color, then gets a threshold value for the Color32.A property, under which the color is considered transparent. If 0, then the pixels to be set will never be transparent.
(Inherited from IBitmapData.)
Public propertyBackColor
When accessing pixels of indexed bitmaps, or setting pixels of bitmaps without alpha support, it gets the color of the background. For example, when setting color values with alpha, which are considered opaque the color to set will be blended with this color before setting the pixel.
See the Remarks section of the GetReadWriteBitmapData extension method for details and examples.
(Inherited from IBitmapData.)
Public propertyFirstRow
Gets an IReadWriteBitmapDataRow instance representing the first row of the current IReadWriteBitmapData. Subsequent rows can be accessed by calling the MoveNextRow method on the returned instance while it returns . Alternatively, you can use the indexer to obtain any row.
See the Examples section of the GetReadWriteBitmapData method for examples.
Public propertyHeight
Gets the height of the current IBitmapData instance in pixels.
(Inherited from IBitmapData.)
Public propertyItem
Gets an IReadWriteBitmapDataRow representing the row of the specified y coordinate in the current IReadWriteBitmapData.
See the Examples section of the GetReadWriteBitmapData method for examples.
Public propertyPalette
Gets a Palette instance representing the colors of the owner Bitmap if it has an indexed PixelFormat, or  if the owner Bitmap is not an indexed one. For indexed bitmaps the PixelFormat property returns Format8bppIndexed, Format4bppIndexed or Format1bppIndexed.
(Inherited from IBitmapData.)
Public propertyPixelFormat
Gets the PixelFormat of the current IBitmapData instance.
See the Remarks section for details.
(Inherited from IBitmapData.)
Public propertyRowSize
Gets the size of a row in bytes, or zero, if this IBitmapData instance does not have an actual raw buffer to access. Otherwise, RowSize is similar to BitmapData.Stride but this property never returns a negative value.
See the Remarks section for details.
(Inherited from IBitmapData.)
Public propertyWidth
Gets the width of the current IBitmapData instance in pixels.
(Inherited from IBitmapData.)
Top
Methods

  NameDescription
Public methodGetPixel
Gets the color of the pixel at the specified coordinates.
See the Remarks section for details.
(Inherited from IReadableBitmapData.)
Public methodSetPixel
Sets the color of the pixel at the specified coordinates.
See the Remarks section for details.
(Inherited from IWritableBitmapData.)
Top
Extension Methods

  NameDescription
Public Extension MethodAdjustBrightness
Adjusts the brightness of the specified bitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodAdjustContrast
Adjusts the contrast of the specified bitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodAdjustGamma
Adjusts the gamma correction of the specified bitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodClear
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClip(Rectangle)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClip(Rectangle)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClip(Rectangle)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodCloneOverloaded.
Gets the clone of the specified source with identical size and pixel format.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(PixelFormat, Palette)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(PixelFormat, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(PixelFormat, Color32, Byte)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(Rectangle, PixelFormat, Palette)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(PixelFormat, IQuantizer, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(Rectangle, PixelFormat, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(Rectangle, PixelFormat, Color32, Byte)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodClone(Rectangle, PixelFormat, IQuantizer, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodCopyTo(IWritableBitmapData, Point, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodCopyTo(IWritableBitmapData, Point, IQuantizer, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodCopyTo(IWritableBitmapData, Rectangle, Point, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodCopyTo(IWritableBitmapData, Rectangle, Point, IQuantizer, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDither
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Point, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, ScalingMode)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Point, IQuantizer, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, Point, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, IDitherer, ScalingMode)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, Rectangle, ScalingMode)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, Point, IQuantizer, IDitherer)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, IQuantizer, IDitherer, ScalingMode)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, Rectangle, IDitherer, ScalingMode)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodDrawInto(IReadWriteBitmapData, Rectangle, Rectangle, IQuantizer, IDitherer, ScalingMode)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodGetColorCount
Gets the actual number of colors of the specified bitmapData. Colors are counted even for indexed bitmaps.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodGetColors
Gets the colors used in the specified bitmapData. A limit can be defined in maxColors.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodInvert
Inverts the colors of the specified bitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodMakeGrayscale
Makes this bitmapData grayscale.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodMakeOpaque
Makes this bitmapData opaque using the specified backColor.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodMakeTransparentOverloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodMakeTransparent(Color32)Overloaded.
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.
(Defined by BitmapDataExtensions.)
Public Extension MethodQuantize
Quantizes an IReadWriteBitmapData using the specified quantizer (reduces the number of colors).
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodReplaceColor
Replaces every oldColor occurrences to newColor in the specified bitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodToBitmap
Converts the specified source to a Bitmap.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodToGrayscale
Returns a new IReadWriteBitmapData, which is the grayscale version of the specified bitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodToTransparentOverloaded.
Returns a new IReadWriteBitmapData, which is the clone of the specified bitmapData with transparent background.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodToTransparent(Color32)Overloaded.
Returns a new IReadWriteBitmapData, which is the clone of the specified bitmapData with transparent background.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodTransformColors(FuncColor32, Color32)Overloaded.
Transforms the colors of this bitmapData using the specified transformFunction delegate.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodTransformColors(FuncColor32, Color32, IDitherer)Overloaded.
Transforms the colors of this bitmapData using the specified transformFunction delegate.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodTrySetPalette
Tries to the set the specified palette for this IWritableBitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Top
See Also

Reference