关于打印panel的问题
[System.Runtime.InteropServices.DllImport("gdi32.dll ")]
public static extern long BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
private Bitmap memoryImage;
private void CaptureScreen()
{
Graphics mygraphics = panelReports.CreateGraphics();
Size s = panelReports.Size;
memoryImage = new Bitmap(s.Width, s.Height, mygraphics);
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
IntPtr dc1 = mygraphics.GetHdc();
IntPtr dc2 = memoryGraphics.GetHdc();
BitBlt(dc2, 0, 0, panelReports.ClientRectangle.Width, panelReports.ClientRectangle.Height, dc1, 0, 0, 13369376);
mygraphics.ReleaseHdc(dc1);
memoryGraphics.ReleaseHdc(dc2);
}
private void printDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(memoryImage, 0, 0);
}
private void stbtnPrint_Click(object sender, EventArgs e)
{
CaptureScreen();
printPreviewDialog1.Width = 800;
printPreviewDialog1.Height = 600;
printPreviewDialog1.Top = 20;
printPreviewDialog1.Left = 10;
if (printPreviewDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.Print();
}
}
打印代码如上,但是如果panel有滚动条出现的话,就只能打印当前窗口的部分了,怎么能打印全了呀
...全文
相关推荐
PANEL全屏打印
PANEL全屏打印,panel带滚动条,当panel超出屏幕大小时,只能打印出当前显示的部分。这个程序,自定义每个小panel的位置,可以把整个panel内的东西都打印出来
打印指定panel内的内容
/// 此类用于将给定的panel控件以所见即所得的方法绘制成Griahp实例以便打印 /// 它只限于panel控件中包含有lable和textBox控件的情况 /// 本类存在的问题是当lable重叠时,还不能清楚它先绘哪一个,这样可能会把本看到的控件在绘制时覆盖掉
c# 实现对panel的打印
winform 对panel里面内容的打印实现
EZ-USB Control Panel
不用介绍了吧,你既然已经知道这个关键词了
富士施乐打印机DP-P355d设置说明.doc
富士施乐打印机DP-P355d设置说明文件,网络IP配制手册,超详细说明


