コード例 #1
0
        public void QuickStart_BarcodeQRCode()
        {
            byte[] dataQR = BarcodesMaker.GetQRCode("QRCode example",
                                                    QRCodeEncodingMethod.Binary,
                                                    QRCodeErrorCorrection.M,
                                                    8);
            using (Image image = Image.FromStream(new MemoryStream(dataQR)))
            {
                image.Save("QRCode.png", System.Drawing.Imaging.ImageFormat.Png);
            }

            FileComparer.AreEqual("etalon_QRCode.png", "QRCode.png").Should().Be(true);
        }
コード例 #2
0
        public void QuickStart_BarcodeGS128()
        {
            byte[] dataBarcodeGS128 = BarcodesMaker.GetBarcode("012345678912ABCD",
                                                               BarcodeType.GS1_128A,
                                                               Color.Black,
                                                               Color.White,
                                                               true,
                                                               MeasureBarcodeUnit.FromPixel(0));
            using (Image image = Image.FromStream(new MemoryStream(dataBarcodeGS128)))
            {
                image.Save("barcodeGS128.png", System.Drawing.Imaging.ImageFormat.Png);
            }

            FileComparer.AreEqual("etalon_barcodeGS128.png", "barcodeGS128.png").Should().Be(true);
        }
コード例 #3
0
        public void QuickStart_BarcodeEAN13_Colors_NoQuiteZones()
        {
            byte[] dataBarcode13 = BarcodesMaker.GetBarcode("0123456789123",
                                                            BarcodeType.EAN_13,
                                                            Color.Green,
                                                            Color.White,
                                                            true,
                                                            MeasureBarcodeUnit.FromPixel(0),
                                                            2,
                                                            false);
            using (Image image = Image.FromStream(new MemoryStream(dataBarcode13)))
            {
                image.Save("barcodeEAN13_2.png", System.Drawing.Imaging.ImageFormat.Png);
            }

            FileComparer.AreEqual("etalon_barcodeEAN13_2.png", "barcodeEAN13_2.png").Should().Be(true);
        }
コード例 #4
0
        public void QuickStart_Barcode_Rotation_270_clockwise()
        {
            byte[] dataBarcode13 = BarcodesMaker.GetBarcode("ABC0123456789123abc,;.",
                                                            BarcodeType.GS1_128B,
                                                            Color.Black,
                                                            Color.White,
                                                            true,
                                                            0,
                                                            2,
                                                            true,
                                                            BarcodeRotation.Clockwise_270);
            using (Image image = Image.FromStream(new MemoryStream(dataBarcode13)))
            {
                image.Save("rotation_270_clockwise.png", System.Drawing.Imaging.ImageFormat.Png);
            }

            FileComparer.AreEqual("etalon_rotation_270_clockwise.png", "rotation_270_clockwise.png").Should().Be(true);
        }