+
-
+
QR Code
-

-
-
-
DataMatrix
-

+
Aztec
-

+

+
+
+
DataMatrix
+

+
Pdf417
+
Code 39
-

+
Code 128
-

+

+
+
+
+
+
Code 39 (pure code)
+

+
+
+
Code 128 (pure code)
+
diff --git a/QR-GEN/Views/Shared/_Layout.cshtml b/QR-GEN/Views/Shared/_Layout.cshtml
index 653433a..63cdb4c 100644
--- a/QR-GEN/Views/Shared/_Layout.cshtml
+++ b/QR-GEN/Views/Shared/_Layout.cshtml
@@ -30,7 +30,7 @@
diff --git a/QR-GEN/utils.cs b/QR-GEN/utils.cs
new file mode 100644
index 0000000..d9100d0
--- /dev/null
+++ b/QR-GEN/utils.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using ZXing;
+using ZXing.QrCode;
+using System.Drawing.Imaging;
+using System.IO;
+using ZXing.Common;
+
+namespace QR_GEN
+{
+ ///
+ /// Utility per Code Generator online
+ ///
+ public class utils
+ {
+ ///
+ /// Genera immagina barcode richeista secondo dimensioni e formato
+ ///
+ ///
+ ///
altezza
+ ///
formati 1D di ZXing
+ ///
indica se SOLO barcode
+ ///
+ public static ActionResult getImage(string dataStr, int hSize, BarcodeFormat formato, bool pureBarcode)
+ {
+ // se vuoto steamware...
+ if (dataStr == null || dataStr == "")
+ {
+ dataStr = "www.steamware.net";
+ }
+ dataStr = dataStr.ToUpper();
+ // url decode...
+ dataStr = HttpUtility.UrlDecode(dataStr);
+ // creo!
+ EncodingOptions options = new EncodingOptions
+ {
+ Height = hSize,
+ Margin = 0,
+ PureBarcode = pureBarcode
+ };
+ BarcodeWriter writer = new BarcodeWriter();
+ writer.Format = formato;
+ writer.Options = options;
+ // scrivo bitmap
+ System.Drawing.Bitmap pixelData = writer.Write(dataStr);
+
+ // Return Image
+ MemoryStream ms = new MemoryStream();
+ pixelData.Save(ms, ImageFormat.Png);
+ ms.Position = 0;
+ return new FileStreamResult(ms, "image/png");
+ }
+ ///
+ /// Genera immagina barcode richeista secondo dimensioni e formato
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static ActionResult getImage2D(ref string id, int hSize, int wSize, BarcodeFormat formato)
+ {
+ // se vuoto steamware...
+ if (id == null || id == "")
+ {
+ id = "www.steamware.net";
+ }
+ id = id.ToUpper();
+ // url decode...
+ id = HttpUtility.UrlDecode(id);
+ // creo!
+ QrCodeEncodingOptions options = new QrCodeEncodingOptions
+ {
+ DisableECI = true,
+ CharacterSet = "UTF-8",
+ Width = wSize,
+ Height = hSize,
+ Margin = 0
+ };
+ BarcodeWriter writer = new BarcodeWriter();
+ writer.Format = formato;
+ writer.Options = options;
+ // scrivo bitmap
+ System.Drawing.Bitmap pixelData = writer.Write(id);
+
+ // Return Image
+ MemoryStream ms = new MemoryStream();
+ pixelData.Save(ms, ImageFormat.Png);
+ ms.Position = 0;
+ return new FileStreamResult(ms, "image/png");
+ }
+ }
+}
\ No newline at end of file