Cursor 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 Cursor 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| 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。 如果此构造函数无法创建临时文件,可能会引发此 IOException 构造函数。 例如,如果唯一的临时文件不可用,可能会引发此 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.