Skip to main content

WriteableBitmap Class

Holds a writeable bitmap image.

Definition

Namespace: Avalonia.Media.Imaging
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public class WriteableBitmap : Bitmap
View Source
InheritanceObjectBitmap → WriteableBitmap

Constructors

WriteableBitmap(PixelSize, Vector, Nullable(PixelFormat), Nullable(AlphaFormat))Initializes a new instance of the WriteableBitmap class.
WriteableBitmap(PixelFormat, AlphaFormat, IntPtr, PixelSize, Vector, Int32)Initializes a new instance of the WriteableBitmap class with existing pixel data The data is copied to the bitmap

Properties

AlphaFormat
(Inherited from Bitmap)
Dpi
(Inherited from Bitmap)
Format
(Overrides Bitmap.Format)
PixelSize
(Inherited from Bitmap)
SizeGets the size of the image, in device independent pixels.
(Inherited from Bitmap)

Methods

CopyPixels(ILockedFramebuffer, AlphaFormat)Copies pixels to the target buffer and transcodes the pixel and alpha format if needed.
(Inherited from Bitmap)
CopyPixels(PixelRect, IntPtr, Int32, Int32)
(Overrides Bitmap.CopyPixels(PixelRect, IntPtr, Int32, Int32))
CreateScaledBitmap(PixelSize, BitmapInterpolationMode)Creates a Bitmap scaled to a specified size from the current bitmap.
(Inherited from Bitmap)
Decode(Stream) 
DecodeToHeight(Stream, Int32, BitmapInterpolationMode)Loads a Bitmap from a stream and decodes at the desired height. Aspect ratio is maintained. This is more efficient than loading and then resizing.
DecodeToWidth(Stream, Int32, BitmapInterpolationMode)Loads a WriteableBitmap from a stream and decodes at the desired width. Aspect ratio is maintained. This is more efficient than loading and then resizing.
Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from Bitmap)
Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize()Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCode()Serves as the default hash function.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
Lock() 
MemberwiseClone()Creates a shallow copy of the current Object.
(Inherited from Object)
Save(Stream, Nullable(Int32))Saves the bitmap to a stream.
(Inherited from Bitmap)
Save(String, Nullable(Int32))Saves the bitmap to a file.
(Inherited from Bitmap)
ToString()Returns a string that represents the current object.
(Inherited from Object)

See Also

Reference

Avalonia.Media.Imaging Namespace