zoukankan      html  css  js  c++  java
  • pictureBox绑定Base64字符串

    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;
                }
  • 相关阅读:
    奔溃瞬间1
    面试知识点blog汇总
    贪心
    树 和 图
    DFS 和 BFS
    STL
    哈希表
    手写堆
    并查集
    二项式反演学习笔记
  • 原文地址:https://www.cnblogs.com/XuPengLB/p/9365972.html
Copyright © 2011-2022 走看看