Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 2
0
        public MainWindow(ProControllerInterface controller, ControlParams controlParams)
        {
            this.controller = controller;
            InitializeComponent();

            // static for now; make change dynamically

            setupView        = new SetupView(controlParams);
            setupTab.Content = setupView;

            outView = new ChromView(Transparency.Outline, true);
            outView.CompSelected  += new SelectCompEventHandler(chromview_CompSelected);
            outView.CompsSelected += new SelectCompsEventHandler(chromview_CompsSelected);
            outView.TimeMode       = false;
            outTab.Content         = outView;

            timeView = new ChromView(Transparency.Outline, true);
            timeView.registerTimeObserver(this);
            timeView.registerTimeObserver(controller);
            timeView.CompSelected  += new SelectCompEventHandler(chromview_CompSelected);
            timeView.CompsSelected += new SelectCompsEventHandler(chromview_CompsSelected);
            timeView.TimeMode       = true;
            timeTab.Content         = timeView;

            peakinfo  = new PeakInfo();
            peaksinfo = new PeaksInfo();
        }
Ejemplo n.º 3
0
        public ChromPage(double width, double height, DateTime timestamp, ChromPageContent pageContent, int page, int npages)
        {
            this.pageContent = pageContent;

            Width  = width;
            Height = height;

            InitializeComponent();

            intoText.Text = string.Format("{0:yyyy/MM/dd HH:mm:ss} - Page {1}/{2}", timestamp, page, npages);

            if (pageContent == ChromPageContent.Chrom)
            {
                chromView = new ChromView(Transparency.Transparent);
                addContent(chromView);
            }
            else if (pageContent == ChromPageContent.Params)
            {
                canvas = new Canvas();
                addContent(canvas);
            }
        }
Ejemplo n.º 4
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();
            }
        }