如何解决Picturebox问题? [英] How Ca I Resolve The Picturebox Problem ?

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

问题描述

每个人都喜欢。



我正在项目中使用图片框。



我的代码:



 尝试 
{
Image img = Image.FromFile( mail.png);
pictureBox1.Image = img;
pictureBox1.Height = img.Height;
pictureBox1.Width = img.Width;
}
catch (例外情况)
{
label1.Text = ex.ToString();
}





错误:

System.io.FilNotFoundExeption ...



有什么问题?

解决方案

你好,

放置图像文件的完整文件路径。更多详细信息

参考: Image.FromFile

hi every body .

i'm using a picture Box in my project .

its my code :

try
           {
               Image img = Image.FromFile("mail.png");
               pictureBox1.Image = img;
               pictureBox1.Height = img.Height;
               pictureBox1.Width = img.Width;
           }
           catch (Exception ex)
           {
               label1.Text = ex.ToString();
           }



Error :
System.io.FilNotFoundExeption ...

what is the problem ?

解决方案

Hello ,
Put the full file path of the Image file.For more details
Refer : Image.FromFile


这篇关于如何解决Picturebox问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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