如何使用图片框 [英] how to use picture box
本文介绍了如何使用图片框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用此代码aftrr从数据库读取图像
Mstream =新内存流(imgbytes);
显示错误参数无效。
I use this code aftrr read image from data base
Mstream=new memory stream(imgbytes);
It shows an error invalid parameter.
推荐答案
这将是:
It would be:
MemoryStream myStream = new MemoryStream(imgbytes);
然后使用图片框它将是:
and then to use the picturebox it would be:
pictureBox.Image = new Bitmap(myStream);
见这里:为什么我得到参数无效。我从数据库中读取图像时出现异常? [ ^ ]
你不应该调用编译器不知道的变量
创建它们使用
you shouldn't call a variable that the complier didn't know
to create them use
MemoryStream myStream = new MemoryStream(imgbytes);
然后设置picturebox.image =你刚刚创建的^^欢呼!
and then set picturebox.image = what you just create ^^ Cheer!
这篇关于如何使用图片框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文