/// <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); }
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; } }