Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        ////////////////////////////////////////////////////////////////////
        // Write object to PDF file
        ////////////////////////////////////////////////////////////////////

        internal override void WriteObjectToPdfFile()
        {
            // convert chart to bitmap
            Picture = new Bitmap(WidthPix, HeightPix);
            MSChart.DrawToBitmap(Picture, new Rectangle(0, 0, WidthPix, HeightPix));
            DisposePicture = true;

            // call Image class WriteObjectToPdfFile
            base.WriteObjectToPdfFile();
            return;
        }