如何在C#中窗口化窗体 [英] How to window form in C#

查看:100
本文介绍了如何在C#中窗口化窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中打印窗口窗体的全屏

How do i print the full screen of window form in C#

推荐答案

下面是代码
Below is the code
protected void btnPrint_Click(object sender, EventArgs e)
{
	PrintDocument pd = new PrintDocument();
	pd.PrintPage += new PrintPageEventHandler(PrintImage);
	pd.Print();      
}
void PrintImage(object o, PrintPageEventArgs e)
{
	int x = SystemInformation.WorkingArea.X;
	int y = SystemInformation.WorkingArea.Y;
	int width = this.Width;
	int height = this.Height; 
	Rectangle bounds = new Rectangle(x, y, width, height); 
	Bitmap img = new Bitmap(width, height); 
	this.DrawToBitmap(img, bounds);
	Point p = new Point(100, 100);
	e.Graphics.DrawImage(img, p);    
 }



PS:首先尝试使用google,如果找不到答案,请询问.



PS: Try google first and if you dont find answer then ask.


这篇关于如何在C#中窗口化窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆