光标文件怎样放入资源文件中,又怎样读取,为什么我读出来的是一块黑色的矩型?
我的代码如下:
写资源文件
ResourceWriter rw=new
ResourceWriter("mygis.resources");
Cursor ss = new Cursor(@"D:\gis\bin\Debug\cursor\ZoomIn.cur");
......
rw.AddResource("Photo",ss);//添加光标
rw.Close();//关闭ResourceWriter。
读取资源
System.Reflection.Assembly assembly =
System.Reflection.Assembly.GetExecutingAssembly();
ResourceManager rm = new ResourceManager("WindowsApplication6.mygis",assembly);
this.Cursor = (System.Windows.Forms.Cursor)(rm.GetObject("Photo"));
我从资源文件取字符串是正确的,可是光标却不行.光标文件没有错误,因为我直接从文件初始化光标是正确的