嗨朋友...将图像保存在文件夹中 [英] Hi Friends...Save Images in Folder

查看:62
本文介绍了嗨朋友...将图像保存在文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows应用程序中,我需要将图像保存在解决方案资源管理器中...我在解决方案资源管理器中具有文件夹图像.....可能需要一段时间才能将应用程序更改为其他驱动器...到正确的时间路径

In Windows Application I need to Save Image In Solution Explorer... I Have Folder Image In Solution Explorer.....May be some time I may change the application to some other drive... that time path to correctly want to get for save image.

推荐答案

将保存的图像放置在Image文件夹中.在图片/图片按钮参考中,只需将网址提到为〜/Image/imagename.imageextension"

PS:我猜您也在将应用程序和Image文件夹一起移动.
Place the save image in the Image folder. And in the image/image button reference just mention the url as "~/Image/imagename.imageextension"

PS: I guess you are moving the application along with Image folder also.


将图像存储为应用程序中的资源.这样,您就可以将其移动到所需的任何位置,并且随时可以从Properties.Resources.名称空间获得所有必要的图像.

当然,您将获得更大的可执行文件.

为此
-打开解决方案资源管理器.
-右键单击您的项目.
-选择属性".
-从水平标签中,选择资源".
-从该标签的菜单中,选择添加资源"(使用小向下箭头).
-选择添加现有文件..."
-在OpenFileDialogue中,选择您的图像(也许您必须摆弄文件类型drow-down).
在下一次构建期间,图像将被编译到可执行文件中.
-您可以通过Properties.Resources.MyImage从代码中获取名为"MyImage.png"的图像.它将为System.Drawing.Bitmap类型.
Store the images as resources within your application. That way you can move it everywhere you want and all necessary images are available anytime from Properties.Resources. namespace.

You will, of course, get a significantly larger executable.

To do that
- Open Solution Explorer.
- Right-click on your project.
- Select "Properties".
- From the horizontal tabs, select "Resources".
- From that tab''s menu, select "Add Resource" (use the small down-arrow).
- Select "Add existing file..."
- In the OpenFileDialogue, select your images (maybe you have to fiddle with the file type drow-down).
During next build, the images get compiled into your executable.
- You can reach an image called "MyImage.png" from your code via Properties.Resources.MyImage. It will be of type System.Drawing.Bitmap.



这篇关于嗨朋友...将图像保存在文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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