IWritableBitmapData Interface

Represents a writable IBitmapData instance. To create an instance use the BitmapDataFactory class or the GetWritableBitmapData extension methods for various platform dependent bitmap implementations.
See the Remarks section of the KGySoft.Drawing namespace for a list about the technologies with dedicated support.
See the Remarks section of the BitmapExtensions.GetReadWriteBitmapData method for details and code samples. That method is for the GDI+ Bitmap type but the main principles apply for all sources.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.1.0
C#
public interface IWritableBitmapData : IBitmapData, 
	IDisposable
Implements
IBitmapData, IDisposable

Properties

AlphaThreshold 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 field, under which the color is considered transparent. If 0, then the pixels to be set will never be transparent.
(Inherited from IBitmapData)
BackColor When accessing pixels of indexed bitmaps, or setting pixels of bitmaps without alpha support, gets the color of the background. For example, when setting color values with alpha, which are considered opaque, they 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)
FirstRow Gets an IWritableBitmapDataRowMovable instance representing the first row of the current IWritableBitmapData. Subsequent rows can be accessed by calling the MoveNextRow method on the returned instance while it returns . Alternatively, you can use the indexer or the GetMovableRow method to obtain any row.
See the Examples section of the GetReadWriteBitmapData method for examples.
Height Gets the height of the current IBitmapData instance in pixels.
(Inherited from IBitmapData)
IsDisposed Gets whether this IBitmapData instance is disposed.
(Inherited from IBitmapData)
Item Gets an IWritableBitmapDataRow representing the row of the specified y coordinate in the current IWritableBitmapData. When obtaining the same row repeatedly, then a cached instance is returned. To get a movable row use the GetMovableRow method instead.
See the Examples section of the GetReadWriteBitmapData method for examples.
Palette Gets a Palette instance representing the colors used in this IBitmapData if PixelFormat represents an indexed format. For indexed bitmaps Indexed property of PixelFormat returns .
(Inherited from IBitmapData)
PixelFormat Gets a PixelFormatInfo of the current IBitmapData instance.
(Inherited from IBitmapData)
RowSize Gets the size of a row in bytes, or zero, if this IBitmapData instance does not have an actual raw buffer to access.
(Inherited from IBitmapData)
Size Gets the size of the current IBitmapData instance in pixels.
(Inherited from IBitmapData)
Width Gets the width of the current IBitmapData instance in pixels.
(Inherited from IBitmapData)
WorkingColorSpace Gets the preferred working color space when dealing with the pixels of this IBitmapData instance. Some operations, such as setting pixels or drawing another bitmap data into this instance consider the value of this property. Operations that use an IQuantizer instance may override the value of this property.
Default value if not implemented: Default. (Only in .NET Core 3.0/.NET Standard 2.1 and above. In earlier targeted frameworks this member must be implemented.)
(Inherited from IBitmapData)

Methods

GetMovableRow Gets an IWritableBitmapDataRowMovable instance representing the row of the specified y coordinate in the current IWritableBitmapData. Unlike the indexer, this method always allocates a new instance.
SetColor32 Sets the color of the pixel at the specified coordinates from a Color32 value.
SetColor64 Sets the color of the pixel at the specified coordinates from a Color64 value.
SetColorF Sets the color of the pixel at the specified coordinates from a ColorF value.
SetPColor32 Sets the color of the pixel at the specified coordinates from a PColor32 value.
SetPColor64 Sets the color of the pixel at the specified coordinates from a PColor64 value.
SetPColorF Sets the color of the pixel at the specified coordinates from a PColorF value.
SetPixel Sets the color of the pixel at the specified coordinates from a Color value.

Extension Methods

BeginClear Begins to clear the content of the specified bitmapData and fills it with the specified color asynchronously.
(Defined by BitmapDataExtensions)
Clear Clears the content of the specified bitmapData and fills it with the specified color.
(Defined by BitmapDataExtensions)
Clear Clears the content of the specified bitmapData and fills it with the specified color inside of an already created, possibly asynchronous context.
(Defined by BitmapDataExtensions)
ClearAsync Begins to clear the content of the specified bitmapData and fills it with the specified color asynchronously.
(Defined by BitmapDataExtensions)
Clip 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. This overload does not dispose source when the result is disposed.
See the Remarks section of the Clip(IWritableBitmapData, Rectangle, Boolean) overload for details.
(Defined by BitmapDataExtensions)
Clip 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.
(Defined by BitmapDataExtensions)
GetPreferredColorSpace Gets a non-default WorkingColorSpace that can be used when working with the specified bitmapData.
(Defined by BitmapDataExtensions)
TrySetPalette Tries to the set the specified palette for this IWritableBitmapData.
(Defined by BitmapDataExtensions)

See Also