示例#1
0
 private 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()));
 }
示例#2
0
 private Task GenerateAndCompareBill(Bill bill, OutputSize outputSize, GraphicsFormat graphicsFormat)
 {
     bill.Format.OutputSize     = outputSize;
     bill.Format.GraphicsFormat = graphicsFormat;
     bill.Format.FontFamily     = "Arial,\"Liberation Sans\"";
     byte[] imageData = QRBill.Generate(bill);
     return(VerifyImages.VerifyPng(imageData));
 }
示例#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));
        }
示例#4
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));
        }