IWritableBitmapData Interface

KGy SOFT Drawing Libraries Help
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.

Namespace:  KGySoft.Drawing.Imaging
Assembly:  KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.0.0-preview.2
Syntax

public interface IWritableBitmapData : IBitmapData, 
	IDisposable

The IWritableBitmapData 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, 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.)
Public propertyFirstRow
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.
Public propertyHeight
Gets the height of the current IBitmapData instance in pixels.
(Inherited from IBitmapData.)
Public propertyIsDisposed
Gets whether this IBitmapData instance is disposed.
(Inherited from IBitmapData.)
Public propertyItem
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.
Public propertyPalette
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.)
Public propertyPixelFormat
Gets a PixelFormatInfo 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.
See the Remarks section for details.
(Inherited from IBitmapData.)
Public propertySize
Gets the size of the current IBitmapData instance in pixels.
(Inherited from IBitmapData.)
Public propertyWidth
Gets the width of the current IBitmapData instance in pixels.
(Inherited from IBitmapData.)
Top
Methods

  NameDescription
Public methodGetMovableRow
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.
Public methodSetColor32
Sets the color of the pixel at the specified coordinates using a Color32 value.
See the Remarks section of the SetPixel method for details.
Public methodSetPixel
Sets the color of the pixel at the specified coordinates.
See the Remarks section for details.
Top
Extension Methods

  NameDescription
Public Extension MethodBeginClear
Begins to clear the content of the specified bitmapData and fills it with the specified color asynchronously.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodClear(Color32, IDitherer)Overloaded.
Clears the content of the specified bitmapData and fills it with the specified color.
(Defined by BitmapDataExtensions.)
Public Extension MethodClear(IAsyncContext, Color32, IDitherer)Overloaded.
Clears the content of the specified bitmapData and fills it with the specified color inside of an already created, possibly asynchronous context.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Public Extension MethodClearAsync
Begins to clear the content of the specified bitmapData and fills it with the specified color asynchronously.
(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. 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.)
Public Extension MethodClip(Rectangle, Boolean)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 MethodTrySetPalette
Tries to the set the specified palette for this IWritableBitmapData.
See the Remarks section for details.
(Defined by BitmapDataExtensions.)
Top
See Also

Reference