static void Main(string[] args) { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); TestApp.Form1 f = new TestApp.Form1(); f.ShowDialog(); return; string ftest = @"C:\_garbage_\TEST_3_CGM.cgm"; //ftest = "ICN-S1000DBIKE-AAA-DA51000-0-U8025-00519-A-04-1.CGM"; //ftest = @"C:\_garbage_\TEST_3_CGM.cgm"; net.sf.jcgm.core.CGM cgmm = new net.sf.jcgm.core.CGM( new java.io.File(ftest)); cgmm.showCGMCommands(new java.io.PrintStream(@"jcgmout.txt")); return; CGMSharp.CGMImage img = new CGMSharp.CGMImage(ftest); System.Drawing.Bitmap bp = new System.Drawing.Bitmap(img.Size.Width, img.Size.Height); System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(bp); gr.Clear(System.Drawing.Color.White); System.Drawing.Size sz = img.Size; //string x = ((CGMSharp.CGMPolyLine)img.structuresFocused[8]).Map; for (int i = 0; i < img.structuresFocused.Count; i++) { if (img.structuresFocused[i] is CGMSharp.CGMPolyLine) { ((CGMSharp.CGMPolyLine)img.structuresFocused[i]).Draw(gr, sz); } } img.getSize(96); //((CGMSharp.CGMPolyLine)img.structuresFocused[8]).Draw(ref gr); bp.Save("test.png", System.Drawing.Imaging.ImageFormat.Png); System.IO.File.WriteAllText("dump.txt", img.TraceLoading); Console.ReadLine(); }
public Form1() { InitializeComponent(); string ftest = "TECHDRAW.CGM"; ftest = @"C:\_garbage_\TEST_1_CGM.cgm"; img = new CGMSharp.CGMImage(ftest); graphicsView1.CGM = img; }