简体   繁体   English

是否可以从设置的X,Y坐标打印Windows窗体

[英]Is it possible to print a windows form from set X,Y coordinates

I am able to print the entire windows form but the top of the printout is not necessary. 我可以打印整个Windows窗体,但不需要顶部打印。 Is there a way to print from specific coordinates ie X = 0 Y = 50. 有没有一种方法可以从特定坐标进行打印,即X = 0 Y = 50。

This is the code i use to print the entire form. 这是我用来打印整个表格的代码。

    private void btn_Print_Click(object sender, EventArgs e)
    {
        printForm1.PrintAction = PrintAction.PrintToPreview;
        printForm1.Print();
    }

Thanks in advance. 提前致谢。

You could use DrawToBitmap method, to get a screenshot of your form. 您可以使用DrawToBitmap方法来获取表单的屏幕截图。 Then edit a bitmap and send it to printer. 然后编辑位图并将其发送到打印机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM