如何将图形作为gif文件保存在硬盘上?

时间:2021-02-01 09:55:16

This is the code:

这是代码:

using (backbuffer = D3Ddev.GetBackBuffer(0, 0, BackBufferType.Mono))
            {
                using (g = backbuffer.GetGraphics())
                {
                    g.SmoothingMode = SmoothingMode.AntiAlias;

                    g.FillPie(myBrush, 256F - distanceFromCenterPixels, 255F - distanceFromCenterPixels,
                    distanceFromCenterPixels * 2F, distanceFromCenterPixels * 2F, angleF - 23F, 46F);
                    if (angleF < 360)
                        g.(@"c:\coneimages\" + angleF + ".gif");
                }
            }

g.Save is not the right way. But somehow i want to save the Pie the FillPie as gif file on the hard disk.

g.Save不是正确的方法。但不知何故,我想将Pie FillPie保存为硬盘上的gif文件。

1 个解决方案

#1


-3  

Check this class out: Image.Save

检查这个课:Image.Save

And check out this post describing how to convert Graphics to an Image. convert Graphics to Image in c#

并查看这篇文章,描述如何将图形转换为图像。在c#中将图形转换为图像

#1


-3  

Check this class out: Image.Save

检查这个课:Image.Save

And check out this post describing how to convert Graphics to an Image. convert Graphics to Image in c#

并查看这篇文章,描述如何将图形转换为图像。在c#中将图形转换为图像