本文介绍了从C#中的图片框中的项目文件夹加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用此代码时,它会在图片框中加载图片:

 pictureBox1.Image = Image.FromFile( @  C:\ Users \ Admin \ source \ _repos \New folder \ TE \ SOFTware of TE \Images \的软件 + str); 



但是当我使用此代码时图片加载成功:

 pictureBox1 .Image = Image.FromFile( @  C:/ Users / Admin / source / repos / TE / Software of Software of TE / images / Washer.Jpg); 



所以请给我解决方案来加载文件夹中的所有图像。



我尝试了什么:



当我使用此代码时,它会在图片框中加载图像:

 pictureBox1.Image = Image.FromFile( @  C :\Users\Admin\source\repos\新文件夹\ TE TE软件软件\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ :

 pictureBox1.Image = Image.FromFile( @  C:/ Users / Admin / source / repos / TE软件/ TE / images / Washer.Jpg软件); 



所以请给加载来自文件夹的所有图像的解决方案。

解决方案


It faild to load image in picturebox when i m using this code:

pictureBox1.Image = Image.FromFile(@"C:\Users\Admin\source\repos\New folder\Software of TE\Software of TE\Images\"+ str);


But When i m using this code Image load Successfully:

pictureBox1.Image = Image.FromFile(@"C: /Users/Admin/source/repos/Software of TE/Software of TE/images/Washer.Jpg");


So please give me the solution to load all images from folder.

What I have tried:

It faild to load image in picturebox when i m using this code:

pictureBox1.Image = Image.FromFile(@"C:\Users\Admin\source\repos\New folder\Software of TE\Software of TE\Images\"+ str);


But When i m using this code Image load Successfully:

pictureBox1.Image = Image.FromFile(@"C: /Users/Admin/source/repos/Software of TE/Software of TE/images/Washer.Jpg");


So please give me the solution to load all images from folder.

解决方案


这篇关于从C#中的图片框中的项目文件夹加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 10:10