using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ZXing;
using ZXing.QrCode;
namespace QR_GEN.Controllers
{
public class GenController : Controller
{
// GET: Gen
public ActionResult Index()
{
return View();
}
///
/// Restituisce un QR code dato valore
///
///
/// Altezza immagine
/// Larghezza immagine
///
public ActionResult QR(string id, int h = 600, int w = 600)
{
BarcodeFormat formato = BarcodeFormat.QR_CODE;
return utils.getImage2D(ref id, h, w, formato);
}
///
/// Restituisce un DataMatrix code dato valore
///
///
/// Altezza immagine
/// Larghezza immagine
///
public ActionResult DataMatrix(string id, int h = 300, int w = 600)
{
BarcodeFormat formato = BarcodeFormat.DATA_MATRIX;
return utils.getImage2D(ref id, h, w, formato);
}
///
/// Restituisce un Aztec code dato valore
///
///
/// Altezza immagine
/// Larghezza immagine
///
public ActionResult Aztec(string id, int h = 600, int w = 600)
{
BarcodeFormat formato = BarcodeFormat.AZTEC;
return utils.getImage2D(ref id, h, w, formato);
}
///
/// Restituisce un Aztec code dato valore
///
///
/// Altezza immagine
/// Larghezza immagine
///
public ActionResult Pdf417(string id, int h = 300, int w = 600)
{
BarcodeFormat formato = BarcodeFormat.PDF_417;
return utils.getImage2D(ref id, h, w, formato);
}
///
/// Restituisce un Code39 1D dato valore
///
///
/// Altezza immagine
/// Indica se mostrare ANCHE testo
///
public ActionResult code39(string id, int h = 75, bool showVal = true)
{
BarcodeFormat formato = BarcodeFormat.CODE_39;
return utils.getImage(id, h, formato, !showVal);
}
///
/// Restituisce un Code128 1D dato valore
///
///
/// Altezza immagine
/// Indica se mostrare ANCHE testo
///
public ActionResult Code128(string id, int h = 75, bool showVal = true)
{
BarcodeFormat formato = BarcodeFormat.CODE_128;
return utils.getImage(id, h, formato, !showVal);
}
}
}