private static Task GenerateAndCompareBill(Bill bill, OutputSize outputSize, GraphicsFormat graphicsFormat)
 {
     bill.Format.OutputSize     = outputSize;
     bill.Format.GraphicsFormat = graphicsFormat;
     byte[] imageData = QRBill.Generate(bill);
     return(VerifyImages.VerifyPng(imageData));
 }
 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()));
 }
        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));
        }
        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));
        }
Exemple #5
0
        public Task QrBillA4_ComparePng()
        {
            Bill bill = SampleData.CreateExample3();

            bill.Format.OutputSize = OutputSize.A4PortraitSheet;

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

            return(VerifyImages.VerifyEmf(png));
        }
Exemple #6
0
        public Task QrBillExtraSpace_ComparePng()
        {
            Bill bill = SampleData.CreateExample5();

            bill.Format.OutputSize = OutputSize.QrBillExtraSpace;

            byte[] emf;
            using (MetafileCanvas canvas = new MetafileCanvas(QRBill.QrBillWithHoriLineWidth, QRBill.QrBillWithHoriLineHeight, "\"Liberation Sans\",Arial, Helvetica"))
            {
                QRBill.Draw(bill, canvas);
                emf = canvas.ToByteArray();
            }

            return(VerifyImages.VerifyEmf(emf));
        }