BitmapSource 類別

定義

提供使用點陣圖格式影像來源之屬性的來源物件。

public ref class BitmapSource : ImageSource
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BitmapSource : ImageSource
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class BitmapSource : ImageSource
Public Class BitmapSource
Inherits ImageSource
繼承
Object Platform::Object IInspectable DependencyObject ImageSource BitmapSource
衍生
屬性

Windows 需求

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

備註

重要

您通常不會直接使用或建立 BitmapSource 類型,這就是您在此頁面上看不到程式碼範例的原因。 建立 BitmapImage 並使用該做為值會比較常見。 如需程式碼範例和詳細資訊,請參閱 BitmapImage的參考頁面。

ImageSource 和 BitmapSourceBitmapImage的中繼基類。 如需如何建立影像來源以用於 Image.SourceImageBrush.ImageSource的詳細資訊,請參閱 Image 和 ImageBrushBitmapImage

BitmapSource 衍生類別

BitmapSource 是 BitmapImageWriteableBitmap的父類別。

建構函式

BitmapSource()

提供 BitmapSource衍生類別的基類初始化行為。

屬性

Dispatcher

取得這個 物件相關聯的 CoreDispatcherCoreDispatcher代表可在 UI 執行緒上存取DependencyObject的功能,即使程式碼是由非 UI 執行緒起始也一樣。

(繼承來源 DependencyObject)
PixelHeight

取得點陣圖的高度 (以像素為單位)。

PixelHeightProperty

識別 PixelHeight 相依性屬性。

PixelWidth

取得點陣圖的寬度 (以像素為單位)。

PixelWidthProperty

識別 PixelWidth 相依性屬性。

方法

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

傳回為相依性屬性建立的任何基底值,如果動畫未使用中,則適用此屬性。

(繼承來源 DependencyObject)
GetValue(DependencyProperty)

DependencyObject傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此DependencyObject實例上特定DependencyProperty的變更。

(繼承來源 DependencyObject)
SetSource(IRandomAccessStream)

藉由存取資料流程來設定 BitmapSource 的來源影像。 大部分的呼叫端都應該改用 SetSourceAsync

SetSourceAsync(IRandomAccessStream)

存取資料流程並以非同步方式處理結果,以設定 BitmapSource 的來源影像。

SetValue(DependencyProperty, Object)

設定 DependencyObject上相依性屬性的本機值。

(繼承來源 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback註冊的變更通知。

(繼承來源 DependencyObject)

適用於

另請參閱