问题描述
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
SaveAsBitmap(pagina);
e.Graphics.DrawImage(bmp1, xST, ySUS);
if (pagina < 6)
{
pagina++;
e.HasMorePages = true;
}
else
e.HasMorePages = false;
}
好的,所以我有一个PrintPreviewDialog,我试图做的是显示并打印多个页面,每个页面都包含bmp1(位图)中的图像.问题是,即使所有页面都正确显示在我的printPreviewDialog中,当单击左上角的打印"按钮时,也只有最后一页正在打印.有任何想法吗?这让我疯狂.谢谢.
P.S. SaveAsBitmap方法调用给定控件的drawToBitmap方法(要打印的控件由SaveAsBitmap的参数给出).
Ok..So I have a PrintPreviewDialog and what I try to do is display and print multiple pages each containing the image in bmp1 (Bitmap). The problem is that even if all the pages are displayed correctly inside my printPreviewDialog, when clicking the Print button in the top left corner, only the last page is printing. Any ideas? It''s driving me crazy. Thanks.
P.S. The SaveAsBitmap method calls the drawToBitmap method of a given control (the control to be printed is given by SaveAsBitmap''s parameter).
推荐答案
if (pagina < 6)
{
pagina++;
e.HasMorePages = true;
}
else
{
pagina = 0;
e.HasMorePages = false;
}
这篇关于使用C#和PrintPreviewDialog进行多页打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!