SoftwareBitmap 類別

定義

表示未壓縮的點陣圖。

public ref class SoftwareBitmap sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.Graphics.Imaging.ISoftwareBitmapFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.GCPressure]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SoftwareBitmap final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.GCPressure]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Graphics.Imaging.ISoftwareBitmapFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class SoftwareBitmap final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Graphics.Imaging.ISoftwareBitmapFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.GCPressure]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SoftwareBitmap : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.GCPressure]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Graphics.Imaging.ISoftwareBitmapFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class SoftwareBitmap : System.IDisposable
function SoftwareBitmap(format, width, height, alpha)
Public NotInheritable Class SoftwareBitmap
Implements IDisposable
繼承
Object Platform::Object IInspectable SoftwareBitmap
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

使用此類別的範例應用程式包括 相機畫面範例

如需示範如何存取圖元資料的程式碼範例,請參閱WriteableBitmap.PixelBuffer屬性 (另請參閱CopyToBuffer 和 CopyFromBuffer) 。

備註

這個類別提供點陣圖的標記法,可讓您輕鬆地搭配不同的影像處理 API 使用。 使用 GetSoftwareBitmapAsync 從資料流程資源建立 SoftwareBitmap,例如影像檔。

使用CopyToBufferCopyFromBuffer來回複製SoftwareBitmapWriteableBitmap的 PixelBuffer 之間的圖元資料。 使用CreateCopyFromSurfaceAsyncIDirect3DSurface建立SoftwareBitmap。 使用ISoftwareBitmapNativeFactory::CreateFromMF2DBuffer2IMF2DBuffer2建立SoftwareBitmap。 使用ISoftwareBitmapNativeFactory::CreateFromIWICBitmap 從 IWICBitmap建立SoftwareBitmap

建構函式

SoftwareBitmap(BitmapPixelFormat, Int32, Int32)

初始化 SoftwareBitmap 類別的新實例。

SoftwareBitmap(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode)

初始化 SoftwareBitmap 類別的新實例。

屬性

BitmapAlphaMode

取得軟體點陣圖的 Alpha 模式。

BitmapPixelFormat

取得軟體點陣圖的像素格式。

DpiX

取得或設定 X 方向的軟體點陣圖每英吋點數。

DpiY

取得或設定 Y 方向軟體點陣圖的每英吋點數。

IsReadOnly

取得值,指出是否可以修改軟體點陣圖。

PixelHeight

取得軟體點陣圖的高度,以圖元為單位。

PixelWidth

取得軟體點陣圖的寬度,以圖元為單位。

方法

Close()

處置物件和相關聯的資源。

Convert(SoftwareBitmap, BitmapPixelFormat)

將現有的 SoftwareBitmap 轉換為具有不同像素格式 的 SoftwareBitmap

Convert(SoftwareBitmap, BitmapPixelFormat, BitmapAlphaMode)

將現有的 SoftwareBitmap 轉換為具有不同像素格式或 Alpha 模式的 SoftwareBitmap

Copy(SoftwareBitmap)

建立所提供 SoftwareBitmap 物件的複本。

CopyFromBuffer(IBuffer)

將圖元資料從 IBuffer 複製到 SoftwareBitmap

CopyTo(SoftwareBitmap)

將目前的 SoftwareBitmap 複製到提供的 SoftwareBitmap 物件。

CopyToBuffer(IBuffer)

將軟體點陣圖圖元資料複製到指定的 IBuffer

CreateCopyFromBuffer(IBuffer, BitmapPixelFormat, Int32, Int32)

執行所提供緩衝區的深層複本,以建立新的 SoftwareBitmap 。 修改新 SoftwareBitmap 中的資料不會影響其建立來源的緩衝區。

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

執行所提供緩衝區的深層複本,以建立新的 SoftwareBitmap 。 修改新 SoftwareBitmap 中的資料不會影響其建立來源的緩衝區。

CreateCopyFromSurfaceAsync(IDirect3DSurface)

執行所提供IDirect3DSurface的深層複本,以非同步方式建立新的SoftwareBitmap。 修改新 SoftwareBitmap 中的資料不會影響其建立來源的介面。

CreateCopyFromSurfaceAsync(IDirect3DSurface, BitmapAlphaMode)

執行所提供IDirect3DSurface的深層複本,以非同步方式建立新的SoftwareBitmap。 修改新 SoftwareBitmap 中的資料不會影響其建立來源的介面。

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

GetReadOnlyView()

取得 SoftwareBitmap 物件的唯讀標記法。

LockBuffer(BitmapBufferAccessMode)

取得 BitmapBuffer 物件,可讓您直接在軟體點陣圖的圖元資料上操作。

適用於

另請參閱