SoftwareBitmapSource
SoftwareBitmapSource
SoftwareBitmapSource
SoftwareBitmapSource
Class
Definition
Provides a source object, backed by a SoftwareBitmap, for properties that use a bitmap-format image source.
public : sealed class SoftwareBitmapSource : ImageSource, IClosable, ISoftwareBitmapSourcepublic sealed class SoftwareBitmapSource : ImageSource, IDisposable, ISoftwareBitmapSourcePublic NotInheritable Class SoftwareBitmapSource Inherits ImageSource Implements IDisposable, ISoftwareBitmapSource// This API is not available in Javascript.
- Inheritance
-
SoftwareBitmapSourceSoftwareBitmapSourceSoftwareBitmapSourceSoftwareBitmapSource
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Remarks
SoftwareBitmapSource lets you to use a SoftwareBitmap as an image source to be displayed using an ImageBrush or directly in an Image control. For example, you can use a SoftwareBitmapSource to display a photo just taken by a device's camera using the LowLagPhotoCapture class, to display an image you have manually decoded using the BitmapDecoder.GetSoftwareBitmapAsync method, or to display a custom IWICBitmap in advanced C++ scenarios where you want to manually manage image memory.
A SoftwareBitmap displayed in a XAML app must be in BGRA pixel format with pre-multiplied alpha values.
A SoftwareBitmap typically stores uncompressed image data. This means it can require a large amount of system memory compared to a compressed format like a Portable Network Graphics (PNG) or JPEG file. Therefore, using a SoftwareBitmap can increase the amount of system memory your app is using, which could impact your app’s performance. Because storing uncompressed image data can use a lot of memory, you can call the Dispose (C#/VB) or Close (C++) method to reduce memory usage when the SoftwareBitmap is longer needed. This causes the associated system resources to be freed immediately rather than waiting for garbage collection.
Constructors
SoftwareBitmapSource() SoftwareBitmapSource() SoftwareBitmapSource() SoftwareBitmapSource()
Initializes a new instance of the SoftwareBitmapSource class.
public : SoftwareBitmapSource()public SoftwareBitmapSource()Public Sub New()// This API is not available in Javascript.
Methods
Close() Close() Close() Close()
Disposes of the object and associated resources.
public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// This API is not available in Javascript.
Remarks
For Microsoft Visual Basic and C#, use the Dispose method.
Dispose() Dispose() Dispose() Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()
SetBitmapAsync(SoftwareBitmap) SetBitmapAsync(SoftwareBitmap) SetBitmapAsync(SoftwareBitmap) SetBitmapAsync(SoftwareBitmap)
Sets the source SoftwareBitmap to be used as an image source.
public : IAsyncAction SetBitmapAsync(SoftwareBitmap softwareBitmap)public IAsyncAction SetBitmapAsync(SoftwareBitmap softwareBitmap)Public Function SetBitmapAsync(softwareBitmap As SoftwareBitmap) As IAsyncAction// This API is not available in Javascript.
- softwareBitmap
- SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap
The SoftwareBitmap to be used as an image source.
An asynchronous action.
Remarks
The SoftwareBitmap must be in BGRA pixel format with pre-multiplied alpha values.