C#添加二维码带加密带logo

#region 生成QR码,加密与logo在此处修改
        public static void CreateQr(string strQrContent, DataTable myTable)
        {
            Qr q = new Qr();
            byte[] bylogo = null;
            //加密?
            //logo
            if (ConfigurationManager.AppSettings.AllKeys.Contains("Logo") && ConfigurationManager.AppSettings["Logo"] != null)
            {
                string strLogoFileName = ConfigurationManager.AppSettings["Logo"];
                FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(string.Format("~/res/images/logo/{0}", strLogoFileName)));
                Bitmap bmp = new Bitmap(file.FullName);
                MemoryStream m = new MemoryStream();
                bmp.Save(m, ImageFormat.Jpeg);
                bylogo = m.GetBuffer();
            }
            myTable.Columns.Add(LY_QR_TABLE.QRCODE_FIELD, typeof(System.Byte[]));
            byte[] byqr = q.GetQr(strQrContent, bylogo);
            myTable.Rows[0][LY_QR_TABLE.QRCODE_FIELD] = byqr;
            myTable.AcceptChanges();
        }

 

猜你喜欢

转载自www.cnblogs.com/wangjp-1233/p/10548930.html
0条评论
添加一条新回复
  
今日推荐