您的位置:首页 > 其它

picturebox加载图片的方法

2013-03-01 13:33 435 查看
1.直接设置picturebox的image属性
2.使用picturebox类的load方法加载图片
picturebox1.load(@"d:\1.jpg");
3.通过设置picturebox类的image属相来显示图片
有两种方式:
a.直接从文件,类似于方法2
picturebox1.image=image.fromfile(@"d:\1.jpg");
b.来源于流
memorystream ms=new memorystream();
ms.write(file,0,file.length);
picturebox1.image=image.fromstream(ms);
其中file是从数据库中读出来的一个byte[]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: