Beispiel #1
0
        public void SaveAsImage(string path, ImageFormat imgFormat, int w, int h, bool addChrome)
        {
            var width  = chart.Width;
            var height = chart.Height;

            using (var bmp = new Bitmap(width, height))
            {
                chart.DrawToBitmap(bmp, new Rectangle(0, 0, width, height));
                using (var bmpScaled = Scale(bmp, (float)w / width, (float)h / height))
                {
                    if (addChrome)
                    {
                        BitmapProcessor.AddChromeEffect(bmpScaled, 180);
                    }
                    bmpScaled.Save(path, imgFormat);
                }
            }
        }