語言

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 該句柄未被選取字型。

適用於