Font.FromHdc(IntPtr) 方法

定義

從裝置內容的指定 Windows 控制代碼建立 Font

public:
 static System::Drawing::Font ^ FromHdc(IntPtr hdc);
public static System.Drawing.Font FromHdc (IntPtr hdc);
static member FromHdc : nativeint -> System.Drawing.Font
Public Shared Function FromHdc (hdc As IntPtr) As Font

參數

hdc
IntPtr

nativeint

裝置內容的控制代碼。

傳回

這個方法建立的 Font

例外狀況

指定之裝置内容的字型不是 TrueType 字型。

備註

若要讓這個方法運作, hdc 參數必須包含選取字型之裝置內容的句柄。 此方法不適用於 hdc 從 GDI+ Graphics 物件取得的句柄,因為 hdc 句柄未選取字型。

適用於