D2D1CreateFactory 函式 (d2d1.h)

建立可用來建立 Direct2D 資源的 Factory 物件。

語法

HRESULT D2D1CreateFactory(
  [in]           D2D1_FACTORY_TYPE          factoryType,
  [in]           REFIID                     riid,
  [in, optional] const D2D1_FACTORY_OPTIONS *pFactoryOptions,
  [out]          void                       **ppIFactory
);

參數

[in] factoryType

類型:D2D1_FACTORY_TYPE

處理站的線程模型及其建立的資源。

[in] riid

類型:REFIID

使用 __uuidof(ID2D1Factory)取得之 ID2D1Factory IID 的參考。

[in, optional] pFactoryOptions

類型:const D2D1_FACTORY_OPTIONS*

提供給偵錯層的詳細數據層級。

[out] ppIFactory

類型:void**

當這個方法傳回時,會包含新處理站指標的位址。

傳回值

類型:HRESULT

如果函式成功,它會傳回 S_OK。 否則,它會傳回 HRESULT錯誤碼

言論

ID2D1Factory 介面提供 Direct2D 的起點。 一般而言,從 Factory 物件的單一實例建立的物件可以與其他從該實例建立的資源搭配使用,但不能與其他 Factory 實例所建立的資源搭配使用。

要求

要求 價值
最低支援的用戶端 適用於 Windows Vista 的 Windows 7、Windows Vista SP2 和平臺更新 [傳統型應用程式 |UWP 應用程式]
支援的最低伺服器 Windows Server 2008 R2、Windows Server 2008 SP2 和 Platform Update for Windows Server 2008 [傳統型應用程式 |UWP 應用程式]
目標平臺 窗戶
標頭 d2d1.h
連結庫 D2d1.lib
DLL D2d1.dll

另請參閱

Direct2D API 概觀