苏飞论坛

标题: 将字节数组转为图片 [打印本页]

作者: 站长苏飞    时间: 2014-10-25 21:27
标题: 将字节数组转为图片
导读部分

【HttpHelper万能框架】教程目录贴  http://www.sufeinet.com/thread-9989-1-1.html
【HttpHelper万能框架】源码购买帖  http://www.sufeinet.com/thread-9926-1-1.html

教程部分


看方法签名

[C#] 纯文本查看 复制代码
  /// <summary>
        /// 将字数组节转为图片
        /// </summary>
        /// <param name=" b">字节数组</param>
        /// <returns>返回图片</returns>
        public static System.Drawing.Image GetImage(byte[] b)


使用方法如下
[C#] 纯文本查看 复制代码

            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = "http://www.sufeinet.com/template/veikei_dz_life_20130810_plus/images/logo.png?2014-06-06",//URL     必需项   
                Method = "get",//URL     可选项 默认为Get   
                ResultType = ResultType.Byte
            };
            HttpResult result = http.GetHtml(item);

            Image img = HttpHelper.GetImage(result.ResultByte);


作者: Cheungnotes    时间: 2014-10-26 12:01
看过帖子回复一下是个好习惯
作者: 水手    时间: 2014-10-26 16:58
强烈支持苏老大、感谢苏老大ing……





欢迎光临 苏飞论坛 (http://www.sufeinet.com/) Powered by Discuz! X3.4