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();
相关文章推荐
- c# ref与out的区别
- 浅谈Tuple之C#4.0新特性
- 异步打开一个文件进行读取
- 浅谈Tuple之C#4.0新特性那些事儿你还记得多少?
- C#高级编程三十天----泛型结构,泛型方法,泛型托付
- 饿汉式单例与懒汉式单例的C#实现
- 跟siki老师学C#第五天
- C#之数组
- C#中常用的几种读取XML文件的方法
- C#静态构造函数和非静态构造函数
- C# 判断字符串为空的4种方法及效率
- RabbitMQ C# driver stops receiving messages
- C# 基础数据与Byte
- C#析构函数与垃圾回收
- C# 拖拽按钮移动
- C#如何加载程序运行目录外的程序集
- C# 反射研究
- C#中两个窗体将相互跳转
- c#中Show和ShowDialog的区别
- C#中堆和栈的区别分析