Cursor 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 Cursor 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| Cursor(Stream) | |
| Cursor(String) |
從指定的Cursor或 .cur 檔案初始化該類別的新實例。 |
| Cursor(Stream, Boolean) |
初始化 Cursor 類別的新執行個體。 |
| Cursor(String, Boolean) |
初始化 Cursor 類別的新執行個體。 |
Cursor(Stream)
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 是 null。
此建構器無法建立暫存檔案。
備註
對於 Stream,WPF 會先將資料寫入暫存檔,然後從該檔案載入 Cursor。 如果這個建構子無法建立暫存檔案,可能會拋出 a IOException 。 例如,若無法使用唯一的暫存檔案,可能會拋出 a IOException 。 要解決這個錯誤,請嘗試刪除不需要的暫存檔案。
另請參閱
適用於
Cursor(String)
從指定的Cursor或 .cur 檔案初始化該類別的新實例。
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
包含游標的檔案。
例外狀況
cursorFile 是 null。
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)
參數
- scaleWithDpi
- Boolean
true若依 DPI 縮放;否則,。 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)
參數
- scaleWithDpi
- Boolean
true若依 DPI 縮放;否則,。 false