Ejemplo n.º 1
0
        private void exportToImageFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmExportChart pfrmExportChart = new frmExportChart();

            pfrmExportChart.thisChart         = pChart;
            pfrmExportChart.nudHeight.Value   = pChart.Height;
            pfrmExportChart.nudHeight.Maximum = pChart.Height * 5; //Restriction of maximum size
            pfrmExportChart.nudWidth.Value    = pChart.Width;
            pfrmExportChart.nudWidth.Maximum  = pChart.Width * 5;
            pfrmExportChart.Show();
        }
Ejemplo n.º 2
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            //Not working properly; 022817 HK
            frmExportChart pfrmExportChart = new frmExportChart();

            //pfrmExportChart.thisChart = pChart;
            pfrmExportChart.thisForm          = this;
            pfrmExportChart.nudHeight.Value   = this.Height;
            pfrmExportChart.nudHeight.Maximum = this.Height * 5; //Restriction of maximum size
            pfrmExportChart.nudWidth.Value    = this.Width;
            pfrmExportChart.nudWidth.Maximum  = this.Width * 5;
            pfrmExportChart.Show();
        }
Ejemplo n.º 3
0
        private void exportToImageFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmExportChart pfrmExportChart = new frmExportChart();

            pfrmExportChart.thisChart         = pChart;
            pfrmExportChart.nudHeight.Value   = pChart.Height;
            pfrmExportChart.nudHeight.Maximum = pChart.Height * 5; //Restriction of maximum size
            pfrmExportChart.nudWidth.Value    = pChart.Width;
            pfrmExportChart.nudWidth.Maximum  = pChart.Width * 5;
            pfrmExportChart.Show();


            //string strOutputPath = null;
            //if (sfdExportImage.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            //{
            //    strOutputPath = string.Concat(sfdExportImage.FileName);

            //    switch (sfdExportImage.FilterIndex)
            //    {
            //        case 1:
            //            pChart.SaveImage(strOutputPath, ChartImageFormat.Bmp);
            //            break;
            //        case 2:
            //            pChart.SaveImage(strOutputPath, ChartImageFormat.Emf);
            //            break;
            //        case 3:
            //            pChart.SaveImage(strOutputPath, ChartImageFormat.Gif);
            //            break;
            //        case 4:
            //            pChart.SaveImage(strOutputPath, ChartImageFormat.Jpeg);
            //            break;
            //        case 5:
            //            pChart.SaveImage(strOutputPath, ChartImageFormat.Png);
            //            break;
            //        case 6:
            //            pChart.SaveImage(strOutputPath, ChartImageFormat.Tiff);
            //            break;
            //    }

            //    //// save to a bitmap
            //    //Bitmap bmp = new Bitmap(pChart.Size.Width, pChart.Size.Height);
            //    //bmp.SetResolution(300, 300);
            //    //bmp.SetResolution(96, 96);
            //    //pChart.DrawToBitmap(bmp, new Rectangle(0, 0, pChart.Size.Width, pChart.Size.Height));
            //    //bmp.Save(strOutputPath);

            //    MessageBox.Show("The export completed successfully (" + strOutputPath + ")");
            //}
        }
Ejemplo n.º 4
0
 private void exportToImageFileToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     try
     {
         frmExportChart pfrmExportChart = new frmExportChart();
         pfrmExportChart.thisChart         = pChart;
         pfrmExportChart.nudHeight.Value   = pChart.Height;
         pfrmExportChart.nudHeight.Maximum = pChart.Height * 5; //Restriction of maximum size
         pfrmExportChart.nudWidth.Value    = pChart.Width;
         pfrmExportChart.nudWidth.Maximum  = pChart.Width * 5;
         pfrmExportChart.Show();
     }
     catch (Exception ex)
     {
         frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
         return;
     }
 }