ImageHelper

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Drawing;

namespace WindowsFormsApplication3.Utility
{
    class ImageHelper
    {
        private ImageHelper() { }

        public static Icon GetIconFromBase64String(string base64String) {
            using (MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(base64String))) {
                return new Icon(memoryStream);
            }
        }

        public static Image GetImageFromBase64String(String base64String) {
            using (MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(base64String))) {
                return new Bitmap(memoryStream);
            }
        }
    }
}
posted on 2014-07-22 23:17  rosizel  阅读(220)  评论(0编辑  收藏  举报