public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var networkIp = CustomNetworkManager.GetAllIps();

            qrImage.Image = new NSImage(QrGenerator.GenerateQR(networkIp));
        }
Exemplo n.º 2
0
        public ActionResult Create(Product p)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    p.QRCode = QrGenerator.GenerateQRCodeString(p);
                    mapper.CreateProduct(p);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.StackTrace);
                }
            }

            return(RedirectToAction("List"));
        }
Exemplo n.º 3
0
        public void AddInfo(Product p)
        {
            using (document)
            {
                document.Open();
                document.SetMarginMirroring(true);
                Paragraph p1   = new Paragraph((p.Name + " : " + p.Description));
                Paragraph p2   = new Paragraph(p.QRCode);
                var       pic1 = iTextSharp.text.Image.GetInstance(QrGenerator.GenerateQRCodeBitmap(p.QRCode, 250), System.Drawing.Imaging.ImageFormat.Jpeg);
                var       pic2 = iTextSharp.text.Image.GetInstance(QrGenerator.GenerateQRCodeBitmap(p.QRCode, 100), System.Drawing.Imaging.ImageFormat.Jpeg);

                p1.Alignment   = Element.ALIGN_CENTER;
                p2.Alignment   = Element.ALIGN_CENTER;
                pic1.Alignment = Element.ALIGN_CENTER;
                pic2.Alignment = Element.ALIGN_CENTER;

                document.Add(p1);
                document.Add(p2);
                document.Add(pic1);
                document.Add(pic2);
            }
        }
Exemplo n.º 4
0
        public ActionResult GetQrCode([FromQuery] string content)
        {
            var qr = QrGenerator.GenerateQrCode(content);

            return(File(qr, "image/jpeg"));
        }