您好,我想将我的所有属性(pictureBox1 + pictureBox2 + ... + Textbox2)记录在一张图像中。
'Include a reference to Microsoft XML v3
Dim XMLDataDrg As DOMDocument30
Set XMLDataDrg = New DOMDocument30
XMLDataDrg.Load ("C:\...\sample.xml")
'...
Dim id As String
id = XMLDataDrg.SelectSingleNode("//Info/MC/Tool").Attributes.getNamedItem("length").Text
答案 0 :(得分:0)
您可以将所有控件归为一个panel
控件。在Button_Click
事件中,您可以获取panel
控件的高度和宽度并将其保存为图像。
Winform设计
按钮单击事件
private void btnSaveImage_Click(object sender, EventArgs e)
{
int width = panel.Size.Width;
int height = panel.Size.Height;
Bitmap bm = new Bitmap(width, height);
panel.DrawToBitmap(bm, new Rectangle(0, 0, width, height));
bm.Save(@"D:\TestDrawToBitmap.png", ImageFormat.Png);
}
已保存图片