Cursor 建構函式

定義

初始化 Cursor 類別的新執行個體。

多載

Cursor(Stream)

從指定的 Stream 初始化 Cursor 類別的新執行個體。

Cursor(String)

從指定的 .ani.cur 檔案,將 Cursor 類別的新執行個體初始化。

Cursor(Stream, Boolean)

初始化 Cursor 類別的新執行個體。

Cursor(String, Boolean)

初始化 Cursor 類別的新執行個體。

Cursor(Stream)

從指定的 Stream 初始化 Cursor 類別的新執行個體。

public:
 Cursor(System::IO::Stream ^ cursorStream);
public Cursor (System.IO.Stream cursorStream);
new System.Windows.Input.Cursor : System.IO.Stream -> System.Windows.Input.Cursor
Public Sub New (cursorStream As Stream)

參數

cursorStream
Stream

包含游標的 Stream

例外狀況

cursorStreamnull

這個建構函式無法建立暫存檔案。

備註

Stream如果是 ,WPF 會將資料寫入暫存盤,然後從檔案載入 Cursor 。 如果這個建構函式無法建立暫存檔, IOException 可能會擲回 。 例如, IOException 如果無法使用唯一的臨時檔,可能會擲回 。 若要解決此錯誤,請嘗試刪除不必要的臨時檔。

另請參閱

適用於

Cursor(String)

從指定的 .ani.cur 檔案,將 Cursor 類別的新執行個體初始化。

public:
 Cursor(System::String ^ cursorFile);
public Cursor (string cursorFile);
new System.Windows.Input.Cursor : string -> System.Windows.Input.Cursor
Public Sub New (cursorFile As String)

參數

cursorFile
String

包含游標的檔案。

例外狀況

cursorFilenull

cursorFile 不是 .ani.cur 檔案名稱。

另請參閱

適用於

Cursor(Stream, Boolean)

初始化 Cursor 類別的新執行個體。

public:
 Cursor(System::IO::Stream ^ cursorStream, bool scaleWithDpi);
public Cursor (System.IO.Stream cursorStream, bool scaleWithDpi);
new System.Windows.Input.Cursor : System.IO.Stream * bool -> System.Windows.Input.Cursor
Public Sub New (cursorStream As Stream, scaleWithDpi As Boolean)

參數

cursorStream
Stream

包含游標的 Stream

scaleWithDpi
Boolean

如果要隨著 dpi 調整,則為 true;否則為 false

適用於

Cursor(String, Boolean)

初始化 Cursor 類別的新執行個體。

public:
 Cursor(System::String ^ cursorFile, bool scaleWithDpi);
public Cursor (string cursorFile, bool scaleWithDpi);
new System.Windows.Input.Cursor : string * bool -> System.Windows.Input.Cursor
Public Sub New (cursorFile As String, scaleWithDpi As Boolean)

參數

cursorFile
String

包含游標的 Stream

scaleWithDpi
Boolean

如果要隨著 dpi 調整,則為 true;否則為 false

適用於