SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap Class

Definition

Represents an uncompressed bitmap.

public : sealed class SoftwareBitmap : IClosable, ISoftwareBitmap
struct winrt::Windows::Graphics::Imaging::SoftwareBitmap : IClosable, ISoftwareBitmap
public sealed class SoftwareBitmap : IDisposable, ISoftwareBitmap
Public NotInheritable Class SoftwareBitmap Implements IDisposable, ISoftwareBitmap
var softwareBitmap = new softwareBitmap(format, width, height);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

This class provides a representation of a bitmap that makes it easy to use with different imaging APIs. Use GetSoftwareBitmapAsync to create a SoftwareBitmap from a stream resource such as an image file. Use CopyToBuffer and CopyFromBuffer to copy pixel data back and forth between a SoftwareBitmap and the PixelBuffer of a WriteableBitmap. Use CreateCopyFromSurfaceAsync to create a SoftwareBitmap from a Direct3DSurface object.

Constructors

SoftwareBitmap(BitmapPixelFormat, Int32, Int32) SoftwareBitmap(BitmapPixelFormat, Int32, Int32) SoftwareBitmap(BitmapPixelFormat, Int32, Int32) SoftwareBitmap(BitmapPixelFormat, Int32, Int32) SoftwareBitmap(BitmapPixelFormat, Int32, Int32)

Initializes a new instance of the SoftwareBitmap class.

SoftwareBitmap(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) SoftwareBitmap(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) SoftwareBitmap(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) SoftwareBitmap(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) SoftwareBitmap(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode)

Initializes a new instance of the SoftwareBitmap class.

Properties

BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

Gets the alpha mode of the software bitmap.

BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

Gets the pixel format of the software bitmap.

DpiX DpiX DpiX DpiX DpiX

Gets or sets the dots per inch of the software bitmap in the X direction.

DpiY DpiY DpiY DpiY DpiY

Gets or sets the dots per inch of the software bitmap in the Y direction.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value indicating whether the software bitmap can be modified.

PixelHeight PixelHeight PixelHeight PixelHeight PixelHeight

Gets the height of the software bitmap, in pixels.

PixelWidth PixelWidth PixelWidth PixelWidth PixelWidth

Gets the width of the software bitmap, in pixels.

Methods

Close() Close() Close() Close() Close()

Disposes of the object and associated resources.

Convert(SoftwareBitmap, BitmapPixelFormat) Convert(SoftwareBitmap, BitmapPixelFormat) Convert(SoftwareBitmap, BitmapPixelFormat) Convert(SoftwareBitmap, BitmapPixelFormat) Convert(SoftwareBitmap, BitmapPixelFormat)

Converts an existing SoftwareBitmap to a SoftwareBitmap with a different pixel format.

Convert(SoftwareBitmap, BitmapPixelFormat, BitmapAlphaMode) Convert(SoftwareBitmap, BitmapPixelFormat, BitmapAlphaMode) Convert(SoftwareBitmap, BitmapPixelFormat, BitmapAlphaMode) Convert(SoftwareBitmap, BitmapPixelFormat, BitmapAlphaMode) Convert(SoftwareBitmap, BitmapPixelFormat, BitmapAlphaMode)

Converts an existing SoftwareBitmap to a SoftwareBitmap with a different pixel format or alpha mode.

Copy(SoftwareBitmap) Copy(SoftwareBitmap) Copy(SoftwareBitmap) Copy(SoftwareBitmap) Copy(SoftwareBitmap)

Creates a copy of the provided SoftwareBitmap object.

CopyFromBuffer(IBuffer) CopyFromBuffer(IBuffer) CopyFromBuffer(IBuffer) CopyFromBuffer(IBuffer) CopyFromBuffer(IBuffer)

Copies the pixel data from an IBuffer into the SoftwareBitmap.

CopyTo(SoftwareBitmap) CopyTo(SoftwareBitmap) CopyTo(SoftwareBitmap) CopyTo(SoftwareBitmap) CopyTo(SoftwareBitmap)

Copies the current SoftwareBitmap into the provided SoftwareBitmap object.

CopyToBuffer(IBuffer) CopyToBuffer(IBuffer) CopyToBuffer(IBuffer) CopyToBuffer(IBuffer) CopyToBuffer(IBuffer)

Copies the software bitmap pixel data into the specified IBuffer.

CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32)

Creates a new SoftwareBitmap by performing a deep copy of the provided buffer. Modifications to the data in the new SoftwareBitmap will not effect the buffer from which it was created.

CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32, BitmapAlphaMode)

Creates a new SoftwareBitmap by performing a deep copy of the provided buffer. Modifications to the data in the new SoftwareBitmap will not effect the buffer from which it was created.

CreateCopyFromSurfaceAsync(IDirect3DSurface) CreateCopyFromSurfaceAsync(IDirect3DSurface) CreateCopyFromSurfaceAsync(IDirect3DSurface) CreateCopyFromSurfaceAsync(IDirect3DSurface) CreateCopyFromSurfaceAsync(IDirect3DSurface)

Asynchronously creates a new SoftwareBitmap by performing a deep copy of the provided IDirect3DSurface. Modifications to the data in the new SoftwareBitmap will not effect the surface from which it was created.

CreateCopyFromSurfaceAsync(IDirect3DSurface, BitmapAlphaMode) CreateCopyFromSurfaceAsync(IDirect3DSurface, BitmapAlphaMode) CreateCopyFromSurfaceAsync(IDirect3DSurface, BitmapAlphaMode) CreateCopyFromSurfaceAsync(IDirect3DSurface, BitmapAlphaMode) CreateCopyFromSurfaceAsync(IDirect3DSurface, BitmapAlphaMode)

Asynchronously creates a new SoftwareBitmap by performing a deep copy of the provided IDirect3DSurface . Modifications to the data in the new SoftwareBitmap will not effect the surface from which it was created.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetReadOnlyView() GetReadOnlyView() GetReadOnlyView() GetReadOnlyView() GetReadOnlyView()

Gets a read-only representation of the SoftwareBitmap object.

LockBuffer(BitmapBufferAccessMode) LockBuffer(BitmapBufferAccessMode) LockBuffer(BitmapBufferAccessMode) LockBuffer(BitmapBufferAccessMode) LockBuffer(BitmapBufferAccessMode)

Gets a BitmapBuffer object that allows you to operate directly on the software bitmap's pixel data.

See Also