Esempio n. 1
0
        /// <summary>
        /// 从一个指定的图片,转换成数据库保存格式的字符串
        /// </summary>
        /// <param name="image">图片</param>
        /// <returns>数据库保存格式的字符串</returns>
        public static string GetValue4DBFromImage(Image image)
        {
            string strCode = "";

            if (image != null)
            {
                strCode = GetImageBase64(image);
                strCode = CommonFuntion.Zip(strCode);
            }

            return(strCode);
        }
Esempio n. 2
0
        public string Value4DBGet()
        {
            string strCode = "";

            if (mImg != null)
            {
                strCode = GetImageBase64(mImg);
                strCode = CommonFuntion.Zip(strCode);
            }

            return(strCode);
        }
Esempio n. 3
0
        /// <summary>
        /// 从一个指定的文件,转换成数据库保存格式的字符串
        /// </summary>
        /// <param name="strFile">文件全名,含扩展名及路径</param>
        /// <returns>数据库保存格式的字符串</returns>
        public static string GetValue4DBFromFile(string strFullFileName)
        {
            string strCode = "";

            if (!File.Exists(strFullFileName))
            {
                throw new FileNotFoundException();
            }

            using (Image image = Image.FromFile(strFullFileName))
            {
                if (image != null)
                {
                    strCode = GetImageBase64(image);
                    strCode = CommonFuntion.Zip(strCode);
                }
            }

            return(strCode);
        }