如何使用c#将system.weing.image转换为system.web.ui.webcontrols.image [英] how to convert convert system.drawing.image to system.web.ui.webcontrols.image using c#
本文介绍了如何使用c#将system.weing.image转换为system.web.ui.webcontrols.image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
byte [] rawImg =(byte [])ds.Tables [0] .Rows [0] [emp_image];
MemoryStream Stream = new MemoryStream();
Stream.Write(rawImg,0,rawImg.Length);
Bitmap Display_Picture = new Bitmap(Stream);
image1 =(Display_Picture);
byte[] rawImg = (byte[])ds.Tables[0].Rows[0]["emp_image"];
MemoryStream Stream = new MemoryStream();
Stream.Write(rawImg, 0, rawImg.Length);
Bitmap Display_Picture = new Bitmap(Stream);
image1 = (Display_Picture);
推荐答案
它们是两个完全不同的东西。System.Web.UI.WebControls.Image
是一个控件,具体来说它会导致img 标记。
System.Drawing.Image
表示位图,图像本身。
可以找到一个潜在的解决方案此处 [ ^ ](完全向下滚动)
They are two completely different things.System.Web.UI.WebControls.Image
is a control, to specific it'll result in animg
tag on an ASP.NET page.System.Drawing.Image
represents a bitmap, the image itself.
A potential solution can be found here[^] (scroll all the way down)
这篇关于如何使用c#将system.weing.image转换为system.web.ui.webcontrols.image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文