Exemplo n.º 1
0
        public string EncodeSvgImage(string val, DmtxImageEncoderOptions options)
        {
            DmtxEncode encode = new DmtxEncode();

            encode.ModuleSize     = options.ModuleSize;
            encode.MarginSize     = options.MarginSize;
            encode.SizeIdxRequest = options.SizeIdx;
            encode.Scheme         = options.Scheme;
            byte[] valAsByteArray = Encoding.ASCII.GetBytes(val);
            encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray);
            return(EncodeSvgFile(encode, "", options.ModuleSize, options.MarginSize, options.ForeColor, options.BackColor));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        private Bitmap EncodeImage(string val, DmtxImageEncoderOptions options, bool isMosaic)
        {
            DmtxEncode encode = new DmtxEncode();

            encode.ModuleSize     = options.ModuleSize;
            encode.MarginSize     = options.MarginSize;
            encode.Scheme         = options.Scheme;
            encode.SizeIdxRequest = options.SizeIdx;
            byte[] valAsByteArray = Encoding.ASCII.GetBytes(val);
            if (isMosaic)
            {
                encode.EncodeDataMosaic(valAsByteArray);
            }
            else
            {
                encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray);
            }
            return(CopyDataToBitmap(encode.Image.Pxl, encode.Image.Width, encode.Image.Height));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        private static Bitmap EncodeImage(byte[] valAsByteArray, DmtxImageEncoderOptions options, bool isMosaic)
        {
            DmtxEncode encode = new DmtxEncode
            {
                ModuleSize     = options.ModuleSize,
                MarginSize     = options.MarginSize,
                SizeIdxRequest = options.SizeIdx,
                Scheme         = options.Scheme,
            };

            if (isMosaic)
            {
                encode.EncodeDataMosaic(valAsByteArray);
            }
            else
            {
                encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray);
            }
            return(CopyDataToBitmap(encode.Image.Pxl, encode.Image.Width, encode.Image.Height));
        }
Exemplo n.º 6
0
 public string EncodeSvgImage(string val, DmtxImageEncoderOptions options)
 {
     DmtxEncode encode = new DmtxEncode();
     encode.ModuleSize = options.ModuleSize;
     encode.MarginSize = options.MarginSize;
     encode.SizeIdxRequest = options.SizeIdx;
     encode.Scheme = options.Scheme;
     byte[] valAsByteArray = Encoding.ASCII.GetBytes(val);
     encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray);
     return EncodeSvgFile(encode, "", options.ModuleSize, options.MarginSize, options.ForeColor, options.BackColor);
 }
Exemplo n.º 7
0
 private Bitmap EncodeImage(string val, DmtxImageEncoderOptions options, bool isMosaic)
 {
     DmtxEncode encode = new DmtxEncode();
     encode.ModuleSize = options.ModuleSize;
     encode.MarginSize = options.MarginSize;
     encode.Scheme = options.Scheme;
     encode.SizeIdxRequest = options.SizeIdx;
     byte[] valAsByteArray = Encoding.ASCII.GetBytes(val);
     if (isMosaic)
     {
         encode.EncodeDataMosaic(valAsByteArray);
     }
     else
     {
         encode.EncodeDataMatrix(options.ForeColor, options.BackColor, valAsByteArray);
     }
     return CopyDataToBitmap(encode.Image.Pxl, encode.Image.Width, encode.Image.Height);
 }