|
小弟刚刚接触到wince开发,用的是vs2005 C# +wince5.0(这个OS是用evc开发的)。我用vs2005 C#做了个wince上的应用程序。在本机的模拟器上能正常显示图片(bmp).但我将exe文件拷到wince上,它就提示错误。(wince 上已经有.net的运行库,图片是作为内嵌资源加载到exe文件中的)。
写的程序如下:- try
- {
- using (Stream FileStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("DeviceApplication2.color.bmp"))
- {
- Bitmap Mymap = new Bitmap(FileStream);
- this.pictureBox1.Image = Mymap;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
复制代码
提示错误信息如下:
ex {"Exception"} System.Exception
_HResult -2146233088 int
_innerException null System.Exception
_message "Exception" string
+ _methodDescs {维数:[9]} System.IntPtr[]
HResult -2146233088 int
InnerException null System.Exception
Message "Exception" string
StackTrace "位于 Microsoft.AGL.Common.MISC.HandleAr()\r\n位于 System.Drawing.Bitmap._InitFromMemoryStream()\r\n位于 System.Drawing.Bitmap..ctor()\r\n位于 DeviceApplication2.Form1.Form1_Load()\r\n位于 System.Windows.Forms.Form.OnLoad()\r\n位于 System.Windows.Forms.Form._SetVisibleNotify()\r\n位于 System.Windows.Forms.Control.set_Visible()\r\n位于 System.Windows.Forms.Application.Run()\r\n位于 DeviceApplication2.Program.Main()\r\n" string
各位大虾帮小弟看看是那里出问题了。在线等。
|
|