/// <summary> /// Commit object to PDF file /// </summary> /// <param name="DisposeChart">Dispose Chart object</param> /// <param name="GCCollect">Activate Garbage Collector</param> public void CommitToPdfFile ( bool DisposeChart, bool GCCollect ) { // make sure not to do it twice if (FilePosition == 0) { // convert chart to bitmap Picture = new Bitmap(WidthPix, HeightPix); MSChart.DrawToBitmap(Picture, new Rectangle(0, 0, WidthPix, HeightPix)); DisposePicture = true; // call save image object of PdfImage parent SaveImageObject(); // dispose chart if (DisposeChart) { MSChart.Dispose(); MSChart = null; } // activate garbage collector if (GCCollect) { GC.Collect(); } } // exit return; }
/// <summary> /// Commit object to PDF file /// </summary> /// <param name="DisposeChart">Dispose Chart object</param> /// <param name="GCCollect">Activate Garbage Collector</param> public void CommitToPdfFile ( bool DisposeChart, bool GCCollect ) { // make sure not to do it twice if (FilePosition == 0) { // call PdfObject routine WriteObjectToPdfFile(); // dispose chart if (DisposeChart) { MSChart.Dispose(); MSChart = null; } // activate garbage collector if (GCCollect) { GC.Collect(); } } // exit return; }