Example #1
0
        public SaveDialog(MosaicInfo mosaicInfo, RoiTool tool)
        {
            InitializeComponent();

            this.tool = tool;

            this.imageRegion = Rectangle.Empty;

            if (tool.Active == true)
                this.imageRegion = tool.TransformedRegionOfInterest;

            tool.RoiToolDrawnHandler += new RoiToolHandler<RoiTool, RoiToolEventArgs>(OnRoiToolDrawnHandler);
            tool.PluginActiveStatusChanged +=
                new MosaicPluginEventHandler<MosaicPlugin, EventArgs>(OnRoiPluginActiveStatusChanged);

            this.widthNumeric.Minimum = 100;
            this.widthNumeric.Maximum = 1000000;
            this.heightNumeric.Minimum = 100;
            this.heightNumeric.Maximum = 1000000;

            if (MosaicWindow.MosaicInfo.TotalWidth > SaveDialog.MaxPossibleWidth)
                this.MaxWidth = MaxPossibleWidth;
            else
                this.MaxWidth = MosaicWindow.MosaicInfo.TotalWidth;

            if (MosaicWindow.MosaicInfo.TotalHeight > SaveDialog.MaxPossibleWidth)
                this.MaxHeight = MaxPossibleHeight;
            else
                this.MaxHeight = MosaicWindow.MosaicInfo.TotalHeight;

            CalculateAspectRatio();

            this.filePathCombo.Items.Add(MosaicWindow.MosaicInfo.DirectoryPath);
            this.filePathCombo.Text = MosaicWindow.MosaicInfo.DirectoryPath;

            this.OnExportSizeNumericValidating(this.widthNumeric, new CancelEventArgs());

            this.widthNumeric.ValueChanged += new EventHandler(this.OnNumericValueChanged);
            this.heightNumeric.ValueChanged += new EventHandler(this.OnNumericValueChanged);
        }
Example #2
0
 void OnRoiToolDrawnHandler(RoiTool sender, RoiToolEventArgs args)
 {
     CalculateAspectRatio();
 }