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

来源:互联网 发布:期货数据分析 编辑:程序博客网 时间:2024/04/19 05:29
        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();

0 0