步骤非常简单:创建具有所需尺寸的位图,然后使用Graphics.FromImage()获取要绘制的图形,然后使用所需格式保存位图:
Bitmap bmp = new Bitmap(200, 100);
Graphics g = Graphics.FromImage(bmp);
g.Clear(...);//fill with the base color
//Draw here
g.DrawLine(...);
g.DrawImage(...); // to draw other images...
bmp.Save("xxx.png",ImageFormat.Png);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1258 次 |
| 最近记录: |