110,566
社区成员
发帖
与我相关
我的任务
分享
public Bitmap GetSnapshot(List<Shape> shapes, int width, int height)
{
Bitmap snapshot = new Bitmap(width, height);
Graphics g = Graphics.FromImage(snapshot);
g.FillRectangle(Brushes.White, new Rectangle(new Point(0, 0), new Size(snapshot.Width, snapshot.Height)));
foreach (Shape sp in shapes) {
sp.Draw(g);
}
return snapshot;
}