public string EncodeSvgImage(string val, DmtxImageEncoderOptions options) { DmtxEncode encode = new DmtxEncode { ModuleSize = options.ModuleSize, MarginSize = options.MarginSize, SizeIdxRequest = options.SizeIdx, Scheme = options.Scheme }; byte[] valAsByteArray = GetRawDataAndSetEncoding(val, options, encode); encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray); return(EncodeSvgFile(encode, "", options.ModuleSize, options.MarginSize, options.ForeColor, options.BackColor)); }
private Bitmap EncodeImage(string val, DmtxImageEncoderOptions options, bool isMosaic) { DmtxEncode encode = new DmtxEncode { ModuleSize = options.ModuleSize, MarginSize = options.MarginSize, SizeIdxRequest = options.SizeIdx }; byte[] valAsByteArray = GetRawDataAndSetEncoding(val, options, encode); if (isMosaic) { encode.EncodeDataMosaic(valAsByteArray); } else { encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray); } return(CopyDataToBitmap(encode.Image.Pxl, encode.Image.Width, encode.Image.Height)); }
public bool[,] EncodeRawData(string val, DmtxImageEncoderOptions options) { DmtxEncode encode = new DmtxEncode { ModuleSize = 1, MarginSize = 0, SizeIdxRequest = options.SizeIdx, Scheme = options.Scheme }; //options.Scheme = DmtxScheme.DmtxSchemeText; //encode.Scheme = DmtxScheme.DmtxSchemeText; //převod z UTF-8 do Win1250 - kvůli diakritice val = Encoding.GetEncoding(1250).GetString(Encoding.GetEncoding("UTF-8").GetBytes(val)); byte[] valAsByteArray = GetRawDataAndSetEncoding(val, options, encode); encode.EncodeDataMatrixRaw(valAsByteArray); return(encode.RawData); }
public Bitmap EncodeImageMosaic(string val, DmtxImageEncoderOptions options) { return(EncodeImage(val, options, true)); }
public Bitmap EncodeImage(string val, DmtxImageEncoderOptions options) { return(EncodeImage(val, options, false)); }