using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.IO; using System.Drawing.Drawing2D; using System.Drawing.Design; using System.Threading; using System.Drawing.Imaging; using System.Configuration; using System.Xml; using InfoSoftGlobal; namespace GraphCapture { public partial class Form1 : UserControl { public Form1() { InitializeComponent(); } public string filePath ; protected void SwfToImage() { Screen screen = Screen.PrimaryScreen; Rectangle bounds = new Rectangle(axShockwaveFlash1.Location, axShockwaveFlash1.Size); using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size); } bitmap.Save(filePath + "/FCF_Column3D.Jpeg", ImageFormat.Jpeg); } } public void GetGraph(XmlDocument strXml,string fPath) { string appPath = "file:///" + Application.StartupPath + "\\FusionCharts\\FCF_Column3D.swf"; appPath = appPath.Replace("\\", "/"); filePath = fPath; FileStream fs = new FileStream(filePath + "\\FCF_Column3D.Xml", FileMode.Open, FileAccess.Read); strXml.Load(fs); //string strChart = filePath + @"?dataXML=" + strXml.InnerXml.Replace("\"","'") + "®isterwithjs=1"; //string ChartXML = appPath + strChart; string ChartXML = appPath + @"?dataXML=" + strXml.InnerXml.Replace("\"", "'").Replace("#", "") + "®isterwithjs=1"; string XML = ChartXML; axShockwaveFlash1.Movie = XML; timer1.Start(); } private void Form1_Load(object sender, EventArgs e) { } private void timer1_Tick(object sender, EventArgs e) { SwfToImage(); timer1.Stop(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)