public ViewResult PrintDetails(Guid id) { ReturnedParcelList parcellist = db.ReturnedParcelLists.Single(p => p.Id == id); int W = 300; int H = 40; b.Alignment = BarcodeLib.AlignmentPositions.CENTER; b.EncodedType = BarcodeLib.TYPE.CODE128; b.IncludeLabel = true; System.Drawing.Image i= b.Encode(b.EncodedType, "IPSP10011189"); System.IO.MemoryStream ms = new System.IO.MemoryStream(); i.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); // getImg(i); byte[] val = ms.GetBuffer(); ViewBag.value = val; return View(parcellist); } public FileContentResult GetFile(byte[] id) { if (id != null) { return new FileContentResult(id, "image/jpeg"); } else { return null; } }
<img src="@Url.Action("GetFile", "ReturnedParcelLists", new { id=ViewBag.value })" alt="Image" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)