많은 바코드를 인쇄해야합니다. 나는 하나의 바코드를 인쇄하려면이 코드 블록을 사용하는 경우 어떻게 루프에서 작업을 수행 할 수 있습니다루프에서 많은 그래픽 개체를 인쇄하는 방법은 무엇입니까?
p.PrintPage += delegate(object sender1, PrintPageEventArgs e1) {
e1.Graphics.DrawString("TITLE", new Font("Univers 55", 6), new SolidBrush(Color.Black), new RectangleF(titleX, titleY, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
e1.Graphics.DrawString(s, new Font("Barcode", 24), new SolidBrush(Color.Black), new RectangleF(codeX, codeY, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
e1.Graphics.DrawString(test, new Font("Univers 55", 8), new SolidBrush(Color.Black), new RectangleF(numberX, numberY, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
을};
titleX, titleY, 분과, codeY, numberX, numberY 각 바코드 객체의 세 부분 (제목, 줄무늬 번호)의 위치를 저장하는 변수이다, 이들은 루프에서 스스로 변경해야합니다.
함수에 넣고 함수를 루프로 호출 하시겠습니까? –