C# WinForm 技巧:控件截图

Point screenPoint = 控件.PointToScreen(new Point());
Rectangle rect = new Rectangle(screenPoint, chartCellLine.Size);
Image img = new Bitmap(rect.Width, rect.Height);
Graphics g = Graphics.FromImage(img);
g.CopyFromScreen(rect.X - , rect.Y - , , , rect.Size);
img.Save(strPicPath, System.Drawing.Imaging.ImageFormat.Jpeg); //截图窗体上任意位置的控件
上一篇:第三百二十二节,web爬虫,requests请求


下一篇:Linux命令之乐--awk