从资源文件加载图片框图像的路径(第三部分) [英] Loading PictureBox Image from resource file with path (Part 3)

查看:150
本文介绍了从资源文件加载图片框图像的路径(第三部分)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,在此之前问题已经被问(并回答)。然而,没有任何解决方案都为我工作。这可能是由于我的无能,巫术诅咒或一些简单而明显的,我很想念。

I understand that this question has been asked (and answered) before. However, none of the solutions are working for me. This may be due to my incompetence, voodoo curses or something simple and obvious that I'm missing.

下面是所有相关的片拼图的屏幕捕获:

Below is a screen capture of all the relevant pieces of the puzzle:

正如你可以看到有加载的资源投入到图像文件夹中的植物众多骨形成蛋白。
有一个名为PlantPicture图片框的形式。有弦,我知道有一个很好的路径(因为我已经在调试器中选中它):

As you can see there are numerous bmps of plants loaded as resources into the Images folder. There is a form with a picturebox named "PlantPicture". There is string, which I know has a good path (because I've checked it in the debugger):

            PicPath = PicPath+".bmp";

我试过装,铸造等,等多种方式。

I've tried numerous ways of loading, casting, etc., etc.

如果你怜,并给它多一枪我会AP preciate任何意见。谢谢!

If you would take pity and give it one more shot I would appreciate any advice. Thanks!

推荐答案

的路径应该是这样的:图片\\ a.bmp。 (注缺乏领导斜线和斜线是返回斜杠。)

The path should be something like: "Images\a.bmp". (Note the lack of a leading slash, and the slashes being back slashes.)

和则:

pictureBox1.Image = Image.FromFile(@"Images\a.bmp");

我刚刚试了一下,以确保和它的作品。这是除了你得到了对方的回答 - 复制总是

I just tried it to make sure, and it works. This is besides the other answer that you got - to "copy always".

这篇关于从资源文件加载图片框图像的路径(第三部分)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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