您的位置:首页 > 编程语言 > C#

C#打印控件内容,控件快照

2016-01-19 22:37 302 查看
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{

Bitmap map = new Bitmap(this.panel1.Width, this.panel1.Height);

this.panel1.DrawToBitmap(map, new Rectangle(0, 0, this.panel1.Width, this.panel1.Height));

e.Graphics.DrawImage(map, 0, 0, this.panel1.Width, this.panel1.Height);

}

this.pageSetupDialog1.Document = this.printDocument1;
this.pageSetupDialog1.ShowDialog();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: