创建设置后如何显示图像? [英] how to displaying image after creating setup?

查看:83
本文介绍了创建设置后如何显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,下面是在图片框中显示图像的代码,它运行正常.

pictureBox1.ImageLocation = @"..\..\Resources\Images\" + dt.Rows[que]["Image_Name"].ToString();


我将我的图像文件夹保存在Resources中,当我对该项目进行设置并将该安装程序安装到其他PC上时,一切运行正常,但是我的图像没有显示.我还试图将我的图像文件夹移到资源外部

解决方案

当图像或其他类型的对象作为对象嵌入时,该文件夹也无法正常工作.

解决方案

您无法通过常规路径访问的资源.这在您的本地系统上有效,因为图像显然位于该路径的物理文件夹中.对于资源,必须使用GetManifestResourceStream方法

http://msdn.microsoft.com/en-us/library/aa287676 (v = vs.71).aspx [


i keep my images folder in Resources,when i make setup of this project and install this setup to other pc''s everything is running fine but my images is not displaying.i also tried to move my images folder to outside of Resources folder it also not working.is there anyone who tell me how can i solve this issue.

解决方案

When an image, or other type of object, is embedded as a resources you can''t access it as a normal path. This is working on your local system because the images are apparently located in the physical folder in that path. For a resources you must use the GetManifestResourceStream method

http://msdn.microsoft.com/en-us/library/aa287676(v=vs.71).aspx[^]


这篇关于创建设置后如何显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆