Ejemplo n.º 1
0
 private static Task GenerateAndComparePngBill(Bill bill, SeparatorType separatorType)
 {
     bill.Format.SeparatorType = separatorType;
     using PNGCanvas canvas    =
               new PNGCanvas(QRBill.A4PortraitWidth, QRBill.A4PortraitHeight, 288, "Arial,Helvetica");
     QRBill.Draw(bill, canvas);
     return(VerifyImages.VerifyPng(canvas.ToByteArray()));
 }
Ejemplo n.º 2
0
 private void GenerateAndComparePngBill(Bill bill, SeparatorType separatorType,
                                        string expectedFileName)
 {
     bill.Format.SeparatorType = separatorType;
     using (PNGCanvas canvas =
                new PNGCanvas(QRBill.A4PortraitWidth, QRBill.A4PortraitHeight, 288, "Arial,Helvetica"))
     {
         QRBill.Draw(bill, canvas);
         FileComparison.AssertGrayscaleImageContentsEqual(canvas.ToByteArray(), expectedFileName);
     }
 }
Ejemplo n.º 3
0
        public Task PngBillQrBill()
        {
            Bill bill = SampleData.CreateExample1();

            byte[] png;
            using (PNGCanvas canvas = new PNGCanvas(QRBill.QrBillWidth, QRBill.QrBillHeight, 300, "\"Liberation Sans\",Arial, Helvetica"))
            {
                bill.Format.OutputSize = OutputSize.QrBillOnly;
                QRBill.Draw(bill, canvas);
                png = canvas.ToByteArray();
            }

            return(VerifyImages.VerifyPng(png));
        }
Ejemplo n.º 4
0
        private void PngBillQrBill()
        {
            Bill bill = SampleData.CreateExample1();

            byte[] svg;
            using (PNGCanvas canvas = new PNGCanvas(QRBill.QrBillWidth, QRBill.QrBillHeight, 300, "Arial"))
            {
                bill.Format.OutputSize = OutputSize.QrBillOnly;
                QRBill.Draw(bill, canvas);
                svg = canvas.ToByteArray();
            }

            FileComparison.AssertGrayscaleImageContentsEqual(svg, "qrbill_ex1.png");
        }
Ejemplo n.º 5
0
        public Task PngBillA4()
        {
            Bill bill = SampleData.CreateExample3();

            byte[] png;
            using (PNGCanvas canvas =
                       new PNGCanvas(QRBill.A4PortraitWidth, QRBill.A4PortraitHeight, 144, "Arial,\"Liberation Sans\",Helvetica"))
            {
                bill.Format.OutputSize = OutputSize.A4PortraitSheet;
                QRBill.Draw(bill, canvas);
                png = canvas.ToByteArray();
            }

            return(VerifyImages.VerifyPng(png));
        }
Ejemplo n.º 6
0
        private void PngBillA4()
        {
            Bill bill = SampleData.CreateExample3();

            byte[] png;
            using (PNGCanvas canvas =
                       new PNGCanvas(QRBill.A4PortraitWidth, QRBill.A4PortraitHeight, 144, "Arial,Helvetica"))
            {
                bill.Format.OutputSize = OutputSize.A4PortraitSheet;
                QRBill.Draw(bill, canvas);
                png = canvas.ToByteArray();
            }

            FileComparison.AssertGrayscaleImageContentsEqual(png, "a4bill_ex3.png");
        }