Beispiel #1
0
        public static void Run()
        {
            //ExStart:FNC1FirstPositionInExtendedMode
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddFNC1FirstPosition();
            lTextBuilder.AddPlainCodetext("000%89%%0");
            lTextBuilder.AddFNC1GroupSeparator();
            lTextBuilder.AddPlainCodetext("12345<FNC1>");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Instantiate barcode object and Set Codetext & SymbologyType
            BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "1234567890");

            // Set encoding mode, error correction level and display text
            generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.ExtendedCodetext;
            generator.Parameters.Barcode.QR.QrErrorLevel = QRErrorLevel.LevelL;
            generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text";

            // Get barcode image Bitmap and Save QR code
            Bitmap lBmp = generator.GenerateBarCodeImage();

            lBmp.Save(dataDir + "FNC1FirstPositionInExtendedMode_out.bmp", ImageFormat.Bmp);
            //ExEnd:FNC1FirstPositionInExtendedMode
            Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "FNC1FirstPositionInExtendedMode_out.bmp");
        }
Beispiel #2
0
        public static void Run()
        {
            //ExStart:FNC1FirstPositionInExtendedMode
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddFNC1FirstPosition();
            lTextBuilder.AddPlainCodetext("000%89%%0");
            lTextBuilder.AddFNC1GroupSeparator();
            lTextBuilder.AddPlainCodetext("12345<FNC1>");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Instantiate barcode object and Set Codetext & SymbologyType
            BarCodeBuilder builder = new BarCodeBuilder("1234567890", EncodeTypes.QR);

            // Set encoding mode, error correction level and display text
            builder.QREncodeMode  = QREncodeMode.ExtendedCodetext;
            builder.QRErrorLevel  = QRErrorLevel.LevelL;
            builder.Display2DText = "My Text";

            // Get barcode image Bitmap and Save QR code
            Bitmap lBmp = builder.GenerateBarCodeImage();

            lBmp.Save(dataDir + "FNC1FirstPositionInExtendedMode_out.bmp", ImageFormat.Bmp);
            //ExEnd:FNC1FirstPositionInExtendedMode
        }
        public static void Run()
        {
            //ExStart:MultiECIModeInExtendedMode
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddECICodetext(ECIEncodings.Win1251, "Will");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF8, "Right");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power");
            lTextBuilder.AddPlainCodetext(@"t\e\\st");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Initialize a BarCodeBuilder class object, Set CodeText, Symbology, Encoding mode, correction level and display text
            BarCodeBuilder builder = new BarCodeBuilder(lCodetext, EncodeTypes.QR);

            builder.QREncodeMode  = QREncodeMode.ExtendedCodetext;
            builder.QRErrorLevel  = QRErrorLevel.LevelL;
            builder.CodeText      = lCodetext;
            builder.Display2DText = "My Text";
            Bitmap lBmp = builder.GenerateBarCodeImage();

            lBmp.Save(dataDir + "MultiECIModeInExtendedMode_out.bmp", ImageFormat.Bmp);
            //ExEnd:MultiECIModeInExtendedMode
        }
        public static void Run()
        {
            //ExStart:MultiECIModeInExtendedMode
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddECICodetext(ECIEncodings.Win1251, "Will");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF8, "Right");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power");
            lTextBuilder.AddPlainCodetext(@"t\e\\st");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Initialize a BarcodeGenerator  class object, Set CodeText, Symbology, Encoding mode, correction level and display text
            BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, lCodetext);

            generator.Parameters.Barcode.QR.QrEncodeMode = QREncodeMode.ExtendedCodetext;
            generator.Parameters.Barcode.QR.QrErrorLevel = QRErrorLevel.LevelL;
            generator.CodeText = lCodetext;
            generator.Parameters.Barcode.CodeTextParameters.TwoDDisplayText = "My Text";

            Bitmap lBmp = generator.GenerateBarCodeImage();

            lBmp.Save(dataDir + "MultiECIModeInExtendedMode_out.bmp", ImageFormat.Bmp);
            //ExEnd:MultiECIModeInExtendedMode
            Console.WriteLine(Environment.NewLine + "Barcode saved at " + dataDir + "MultiECIModeInExtendedMode_out.bmp");
        }
Beispiel #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int    w   = Convert.ToInt32(TextBox2.Text);
            int    h   = Convert.ToInt32(TextBox3.Text);
            string str = TextBox1.Value;

            lbl.InnerText = str.Length.ToString();
            //var aa = new ServiceReference1.FirmForTMTResponse();

            //create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddFNC1FirstPosition();
            //lTextBuilder.AddPlainCodetext("000%89%%0");
            lTextBuilder.AddPlainCodetext(str);
            lTextBuilder.AddFNC1GroupSeparator();
            //lTextBuilder.AddPlainCodetext("12345<FNC1>");

            //generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            //generate
            BarCodeBuilder builder = new BarCodeBuilder();

            // set its Symbology
            builder.SymbologyType = Symbology.QR;
            // set encoding mode
            builder.QREncodeMode = QREncodeMode.ExtendedCodetext;
            // set error correction level
            builder.QRErrorLevel = QRErrorLevel.LevelL;
            // set code text
            builder.CodeText = lCodetext;
            // set display text
            //builder.Display2DText = "";

            builder.CodeLocation = Aspose.BarCode.CodeLocation.None;

            //builder.AutoSize = false;
            //builder.ImageHeight = 400;
            //builder.ImageWidth = 400;

            // get barcode image Bitmap
            Bitmap lBmp = builder.GenerateBarCodeImage();

            //Bitmap lBmp = builder.GetCustomSizeBarCodeImage(new Size(100, 100), true);
            //Bitmap lBmp = builder.GetOnlyBarCodeImage(1);
            Graphics g1 = Graphics.FromImage(lBmp);

            g1.FillRectangle(Brushes.White, new Rectangle(0, 0, lBmp.Width, 12));

            //Bitmap newlbmp = KiResizeImage(lBmp, w, h);
            // save QR code
            //newlbmp.Save(@"d:\test_qr.png", ImageFormat.Png);
            lBmp.Save(@"d:\test_qr.png", ImageFormat.Png);
        }
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddECICodetext(ECIEncodings.Win1251, "Will");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF8, "Right");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power");
            lTextBuilder.AddPlainCodetext(@"t\e\\st");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Initialize a BarCodeBuilder class object

            BarCodeBuilder builder = new BarCodeBuilder();

            // Set its Symbology
            builder.SymbologyType = Symbology.QR;

            // set encoding mode
            builder.QREncodeMode = QREncodeMode.ExtendedCodetext;

            // Set error correction level
            builder.QRErrorLevel = QRErrorLevel.LevelL;

            // Set code text
            builder.CodeText = lCodetext;

            // Set display text
            builder.Display2DText = "My Text";

            // Get barcode image Bitmap
            Bitmap lBmp = builder.GenerateBarCodeImage();

            // Save QR code
            lBmp.Save(dataDir + "MultiECIModeInExtendedMode_out.bmp", ImageFormat.Bmp);
        }
Beispiel #7
0
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();

            lTextBuilder.AddFNC1SecondPosition("12");
            lTextBuilder.AddPlainCodetext("TRUE3456");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Instantiate barcode object
            BarCodeBuilder builder = new BarCodeBuilder();

            // Set its Symbology
            builder.SymbologyType = Symbology.QR;

            // Set encoding mode
            builder.QREncodeMode = QREncodeMode.ExtendedCodetext;

            // Set error correction level
            builder.QRErrorLevel = QRErrorLevel.LevelL;

            // Set code text
            builder.CodeText = lCodetext;

            // Set display text
            builder.Display2DText = "My Text";

            // Get barcode image Bitmap
            Bitmap lBmp = builder.GenerateBarCodeImage();

            // Save QR code
            lBmp.Save(dataDir + "FNC1SecondPositionInExtendedMode.bmp", ImageFormat.Bmp);
        }
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
            lTextBuilder.AddFNC1SecondPosition("12");
            lTextBuilder.AddPlainCodetext("TRUE3456");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Instantiate barcode object and Set its CodeText, encoding mode, error correction level,  display text and Symbology
            BarCodeBuilder builder = new BarCodeBuilder(lCodetext, EncodeTypes.QR);
            builder.QREncodeMode = QREncodeMode.ExtendedCodetext;
            builder.QRErrorLevel = QRErrorLevel.LevelL;
            builder.Display2DText = "My Text";

            // Get barcode image Bitmap and Save QR code
            Bitmap lBmp = builder.GenerateBarCodeImage();
            lBmp.Save(dataDir + "FNC1SecondPositionInExtendedMode_out.bmp", ImageFormat.Bmp);
        }
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_CreateAndManage2DBarCodes();

            // Create codetext
            QrExtCodetextBuilder lTextBuilder = new QrExtCodetextBuilder();
            lTextBuilder.AddECICodetext(ECIEncodings.Win1251, "Will");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF8, "Right");
            lTextBuilder.AddECICodetext(ECIEncodings.UTF16BE, "Power");
            lTextBuilder.AddPlainCodetext(@"t\e\\st");

            // Generate codetext
            string lCodetext = lTextBuilder.GetExtendedCodetext();

            // Initialize a BarCodeBuilder class object, Set CodeText, Symbology, Encoding mode, correction level and display text
            BarCodeBuilder builder = new BarCodeBuilder(lCodetext, EncodeTypes.QR);
            builder.QREncodeMode = QREncodeMode.ExtendedCodetext;
            builder.QRErrorLevel = QRErrorLevel.LevelL;
            builder.CodeText = lCodetext;
            builder.Display2DText = "My Text";
            Bitmap lBmp = builder.GenerateBarCodeImage();
            lBmp.Save(dataDir + "MultiECIModeInExtendedMode_out.bmp", ImageFormat.Bmp);
        }