博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pictureBox绑定Base64字符串
阅读量:6993 次
发布时间:2019-06-27

本文共 683 字,大约阅读时间需要 2 分钟。

if (!string.IsNullOrEmpty(imageCode))            {                byte[] bytes = Convert.FromBase64String(imageCode);                MemoryStream s = new MemoryStream(bytes, true);                s.Write(bytes, 0, bytes.Length);                Image a = new Bitmap(s);                Bitmap bit = new Bitmap(this.pictureBox.Width, this.pictureBox.Height);                Graphics g = Graphics.FromImage(bit);//从指定的 Image 创建新的 Graphics(绘图)。                g.DrawImage(a, new Rectangle(0, 0, bit.Width, bit.Height), new Rectangle(0, 0, a.Width, a.Height), GraphicsUnit.Pixel);                this.pictureBox.Image = bit;            }

 

转载于:https://www.cnblogs.com/XuPengLB/p/9365972.html

你可能感兴趣的文章
手动制作mini linux详细步骤—之一
查看>>
kali密码离线破解
查看>>
Bootstrap优秀模板-Unify.2.6.2
查看>>
poj 3122 Pie (二分)
查看>>
在面试中如何展示虚拟机和内存调优技能
查看>>
C++命名空间学习笔记
查看>>
购物商城Web开发第五天
查看>>
剑指Offer第36题—Java版
查看>>
txt 简单操作
查看>>
jquery $(document).ready() 与window.onload的区别
查看>>
解决Android中,禁止ScrollView内的控件改变之后自动滚动
查看>>
Windows Phone 使用FlurrySdk
查看>>
如何使用git上传代码
查看>>
动态删除下拉框内容
查看>>
Lifestyle
查看>>
spring+shiro共享session完整小例子
查看>>
GitLab 环境搭建【CentOS7】
查看>>
Python.__init__.py
查看>>
面试题总结(三)、《STL源码剖析》相关面试题总结
查看>>
WebViewCLient too slow to be used
查看>>