本文介绍了如何保存无边框的表格控制箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的.

我有一个表单,其中包含一些内容,希望允许我的用户另存为位图或jpeg.我有一个保存"按钮,当用户单击它时,它想为该表单内容(没有边框和控制箱)拍摄快照,并打开保存文件"对话框,使用户可以决定要保存文件的位置. br/>
请说明您的解决方案,这是C#中的新增功能.

Hi dears.

I have a form that with some content that I want to allow my users to save as a bitmap or jpeg. I have a Save button that when the user clicks it, like to take a snapshot of that form content (without border and controlbox) and have a Save File Dialog open up that allows the user to decide where they want to save the file.

Please explain your solution,i''m new in C#.

推荐答案


private void SaveToImage(string FilePath)
{
     Bitmap a = new Bitmap(panel1.Width, panel1.Height);
     panel1.DrawToBitmap(a, new Rectangle(0, 0, panel1.Width, panel1.Height));
     a.Save(FilePath);
}


这篇关于如何保存无边框的表格控制箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 23:50
查看更多