/// <summary> /// Parse QueryString that define the QR code properties /// </summary> /// <param name="request">HttpRequest containing HTTP GET data</param> /// <returns>A QR code descriptor object</returns> public static CodeDescriptor Init(ErrorCorrectionLevel level, string content, QuietZoneModules qzModules, int moduleSize) { var cp = new CodeDescriptor(); //// Error correction level cp.Ecl = level; //// Code content to encode cp.Content = content; //// Size of the quiet zone cp.QuietZones = qzModules; //// Module size cp.ModuleSize = moduleSize; return(cp); }
public RepSOLoading(OrderSortPrintEntity dataSource, string module) : this() { var codeParams = CodeDescriptor.Init(ErrorCorrectionLevel.H, dataSource.RandomCode.Trim(), QuietZoneModules.Two, 5); codeParams.TryEncode(); // Render the QR code as an image using (var ms = new MemoryStream()) { codeParams.Render(ms); Image image = Image.FromStream(ms); xrPictureBox.Image = image; //if (image != null) // xrPictureBox.SizeMode = image.Height > xrPictureBox.Height ? PictureBoxSizeMode.Zoom : PictureBoxSizeMode.Normal; } this._dataSource = dataSource; this._module = module; }