我想用一个图片(如ice.bmp)作为我的光标图案,怎样设置?光标的后缀不是.cur吗?
我在MSDN上它是这样说的:
// To add a custom cursor, create or use an existing 16x16 bitmap
// 1. Add a new cursor file to your project:
// File->Add New Item->Local Project Items->Cursor File
// 2. Select 16x16 image type:
// Image->Current Icon Image Types->16x16
其中第一条就是自己绘制,第二条是用已存在的图片做光标,可我没有找到Image这个选项啊!!
一般的自定义光标是 Cursor a = new Cursor(GetType(),"Mycursor.cur");
望高手不吝赐教!
我在MSDN上它是这样说的:
// To add a custom cursor, create or use an existing 16x16 bitmap
// 1. Add a new cursor file to your project:
// File->Add New Item->Local Project Items->Cursor File
// 2. Select 16x16 image type:
// Image->Current Icon Image Types->16x16
其中第一条就是自己绘制,第二条是用已存在的图片做光标,可我没有找到Image这个选项啊!!
一般的自定义光标是 Cursor a = new Cursor(GetType(),"Mycursor.cur");
望高手不吝赐教!
this.Cursor=new Cursor(cursorPath);
你的cursorPath就是图片的路径吗?那和光标文件有什么关系呢?
cursorPath是图片的路径
我刚才试了一下不行,Cursor a = new Cursor(Classes.Properties.Resources.attendance);
其中attendance就是那个图片,是.gif格式的。
还有我要使用另一种重载,就是我开始写的那种,因为我需要那个GetType()
望继续回帖,万分感谢!
这里举最简单的:
Bitmap bm = new BitMap() 自己定义图片
IntPtr pt = bm.GetHicon();
this.Cursor = new Cursor(pt);
Cursor a = new Cursor(GetType(),"Mycursor.cur");
能否接着指点一下