Esempio n. 1
0
        /// <summary>
        /// 从数据库保存的图片数据转换成图片
        /// </summary>
        /// <param name="value">图片数据字符串</param>
        /// <returns>图片</returns>
        public static Image GetImageFromValue4DB(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(null);
            }

            byte[] buffers = null;
            Image  img     = null;

            if (!string.IsNullOrEmpty(value))
            {
                string strCode = CommonFuntion.UnZip(value);
                img = ImageFromBase64(strCode, out buffers);
            }

            return(img);
        }
Esempio n. 2
0
        public void Value4DBSet(string value)
        {
            byte[] buffers = null;
            Image  img     = null;

            if (!string.IsNullOrEmpty(value))
            {
                string strCode = CommonFuntion.UnZip(value);
                img = ImageFromBase64(strCode, out buffers);
            }

            this.Image = img;

            if (buffers != null)
            {
                mbImageFromStream = true;
                mBuffers          = buffers;
            }
        }