Click here to Skip to main content
15,917,176 members

Comments by cSharpArrow (Top 4 by date)

cSharpArrow 17-May-18 2:33am View    
but when i tried to make what the loop does, it worked perfectly such as:

p.PrintPage += delegate (object sender1, PrintPageEventArgs e1)
{
e1.Graphics.DrawImage(pbx[0].Image, 30, 0);
e1.Graphics.DrawString((1).ToString(), new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(Color.Black), new RectangleF(75, 5, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
};

p.PrintPage += delegate (object sender1, PrintPageEventArgs e1)
{
e1.Graphics.DrawImage(pbx[1].Image, 121, 0);
e1.Graphics.DrawString((1).ToString(), new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(Color.Black), new RectangleF(166, 5, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
};

p.PrintPage += delegate (object sender1, PrintPageEventArgs e1)
{
e1.Graphics.DrawImage(pbx[2].Image, 212, 0);
e1.Graphics.DrawString((1).ToString(), new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(Color.Black), new RectangleF(257, 5, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
};

p.PrintPage += delegate (object sender1, PrintPageEventArgs e1)
{
e1.Graphics.DrawImage(pbx[3].Image, 303, 0);
e1.Graphics.DrawString((1).ToString(), new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(Color.Black), new RectangleF(348, 5, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
};

p.Print();

and i think the loop does the exact same steps, can you explain this please?
cSharpArrow 15-May-18 7:52am View    
i just need to adjust the code I've written to print the whole images created in the loop in one page, my problem that it prints only the last image..
cSharpArrow 14-May-18 8:24am View    
do you have a way to do it??
cSharpArrow 14-May-18 8:10am View    
for (int i = 0; i < QRLoop; i++)
{

int iSerial = Convert.ToInt32(txtSerialFrom.Text) + i;
string QRString = iSerial.ToString() + "," + dtpDate.Value.ToShortDateString() + "," + JobNr + "," + Batch + "," + LineNr + "," + Model;
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(QRString, QRCodeGenerator.ECCLevel.L, false, false, QRCodeGenerator.EciMode.Default, -1);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(1);
pbx[i].Image = qrCode.GetGraphic(1);
}