代码如下:
List
private void button打印_Click(object sender, EventArgs e)
{
try
{
printDocument.DefaultPageSettings.Landscape = true;
printDocument.Print();
}
catch
{ //停止打印
printDocument.PrintController.OnEndPrint(printDocument, new System.Drawing.Printing.PrintEventArgs());
}
}
private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int y = 0;
for (int i = 0; i < maps.Count; i++)
{
e.Graphics.DrawImage(maps[i], 20, y + 20);
y = y + e.PageBounds.Height;
}
if (maps.Count > 1)
e.HasMorePages = true;
}
而且打印出来的只有第一页