コード例 #1
0
ファイル: DmtxImageEncoder.cs プロジェクト: ericramses/YPILIS
        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));
        }
コード例 #2
0
ファイル: DmtxImageEncoder.cs プロジェクト: ericramses/YPILIS
 public Bitmap EncodeImage(string val, DmtxImageEncoderOptions options)
 {
     return(EncodeImage(val, options, false));
 }
コード例 #3
0
ファイル: DmtxImageEncoder.cs プロジェクト: ericramses/YPILIS
 public Bitmap EncodeImageMosaic(string val, DmtxImageEncoderOptions options)
 {
     return(EncodeImage(val, options, true));
 }