如何打印当前表格(Windows应用程序) [英] how to print the current form (windows application)

查看:111
本文介绍了如何打印当前表格(Windows应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告诉我打印当前窗口表单的方法

please show me the way to print the current window form

推荐答案

我认为您可以使用此代码捕获当前窗口

I think you can use this code for capturing current window

 Rectangle bounds = this.Bounds;
 using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
 {
    using (Graphics g = Graphics.FromImage(bitmap))
    {
        g.CopyFromScreen(new Point(bounds.Left,bounds.Top), Point.Empty, bounds.Size);
    }
//Your path in storage device to save it.
bitmap.Save("", ImageFormat.Jpeg);
 }


这篇关于如何打印当前表格(Windows应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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