来自MemoryStream的按钮背景图片

时间:2014-04-26 13:27:33

标签: c# winforms picturebox memorystream

我需要从流中应用背景图片(图片应该从数据库中获取)。 我有这个代码从数据库(流)

获取图像
PictureBox pictureBox = new PictureBox();
if (!list_computer_imageRow.IspicNull())
{
MemoryStream stream = new MemoryStream(list_computer_imageRow.pic);
try
{
pictureBox.Image = Image.FromStream(stream);
}
catch (Exception)
{
}

我试试这个:

this.button1.BackgroundImage = Image.FromStream(stream); 

但是当我运行应用程序时,背景图像没有出现,我只看到带文字的按钮。我的错在哪里?

0 个答案:

没有答案
相关问题