// GET: Mob/Home /// <summary> /// /// </summary> /// <param name="id">ShareCode</param> /// <returns></returns> public async Task <ActionResult> Index(string id, int size = 9) { MemberHelper helper = new MemberHelper(); Member member = await helper.GetByShareCodeAsync(id); string strIconPath = member == null ? "" : member.Avatar; string strContent = HttpContext.Request.Url.Scheme + "://" + HttpContext.Request.Url.Authority + "/Mob/Home/Index/" + id; Bitmap bitMap = QrCodeHelper.Create(strContent, size, strIconPath); return(File(TypeHelper.Bitmap2Byte(bitMap), "image/Jpeg")); }
// GET: Qr public ActionResult Index(string code, int p = 9) { Bitmap bitMap = QrCodeHelper.Create(code, p, ""); return(File(TypeHelper.Bitmap2Byte(bitMap), "image/png")); }