예제 #1
0
        public void exportImages()
        {
            if (currentView == ViewType.Time)
            {
                FileDialog dialog = new SaveFileDialog();
                double     width  = 1920;
                double     height = 1080;
                int        ntime  = view.getChromNtime();
                string     filename;

                dialog.Filter = "PNG files (*.png)|*.png|All files (*.*)|*.*";
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    ChromView chromView = new ChromView(Transparency.Opaque);
                    chromView.outParams = view.getChromOutParams();
                    chromView.TimeMode  = true;
                    chromView.Arrange(new Rect(new Size(width, height)));
                    chromView.UpdateLayout();

                    for (int timei = 0; timei < ntime; timei++)
                    {
                        filename = Util.createNumberedFilename(dialog.FileName, timei);

                        chromView.setChromTimei(timei);
                        chromView.UpdateLayout();
                        Util.saveBitmapImage(Util.visualToBitmap(chromView, width, height), filename);

                        Util.gcCollect();
                        view.updateProgress((float)timei / ntime);
                        System.Windows.Forms.Application.DoEvents();
                    }
                    view.clearProgress();
                }
            }
        }
예제 #2
0
        public void exportImage()
        {
            if (currentView != ViewType.Setup)
            {
                FileDialog dialog = new SaveFileDialog();
                double     width, height, dpi;
                dialog.Filter = "PNG files (*.png)|*.png|All files (*.*)|*.*";
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    dpi    = optionParams.exportDpi;
                    width  = Util.convertToDpi(printing.getWidth(), dpi);
                    height = Util.convertToDpi(printing.getHeight(), dpi);

                    ChromView chromView = new ChromView(Transparency.Partial);
                    chromView.visOutSet = view.getChromVisOutSet();
                    chromView.Arrange(new Rect(new Size(width, height)));
                    chromView.UpdateLayout();

                    Util.saveBitmapImage(Util.visualToBitmap(chromView, width, height), dialog.FileName);
                }
                Util.gcCollect();
            }
        }