Пример #1
0
        private DlgPhotoFullSize()
        {
            if (isUp)
            {
                // duplicate for this instance stays true, so that all functions are disabled
                // and the form will be closed on load.
                this.duplicate = true;
                this.Load     += new System.EventHandler(this.DlgPhotoFullSize_Load);                   // we will close this instance on load
            }
            else
            {
                This      = this;
                duplicate = false;
                InitializeComponent();

                //
                // photoViewerControl
                //
                this.photoViewerControl = new LibSys.PhotoViewerControl();
                this.viewerPanel.Controls.AddRange(new System.Windows.Forms.Control[] { this.photoViewerControl });
                this.photoViewerControl.Dock       = System.Windows.Forms.DockStyle.Fill;
                this.photoViewerControl.Name       = "photoViewerControl";
                this.photoViewerControl.photoDescr = m_photoDescr;
                this.photoViewerControl.TabIndex   = 1;
                this.photoViewerControl.Cursor     = Cursors.Hand;
                this.photoViewerControl.Click     += new System.EventHandler(this.photoViewerControl_Click);

                photoPropertiesPopup = new PhotoPropertiesPopup();

                setPhotoDetail();

                fitToSizeCheckBox.Checked  = Project.photoFitToSize;
                keepInViewCheckBox.Checked = m_keepInView;

                if (Project.fitsScreen(Project.photoFullSizeX, Project.photoFullSizeY, Project.photoFullSizeWidth, Project.photoFullSizeHeight))
                {
                    inResize        = true;
                    this.Location   = new Point(Project.photoFullSizeX, Project.photoFullSizeY);
                    this.ClientSize = new System.Drawing.Size(Project.photoFullSizeWidth, Project.photoFullSizeHeight);                                 // causes Resize()
                }

                setupButtons();

                Project.setDlgIcon(this);
            }
        }
Пример #2
0
        private DlgPhotoFullSize()
        {
            if(isUp)
            {
                // duplicate for this instance stays true, so that all functions are disabled
                // and the form will be closed on load.
                this.duplicate = true;
                this.Load += new System.EventHandler(this.DlgPhotoFullSize_Load);	// we will close this instance on load
            }
            else
            {
                This = this;
                duplicate = false;
                InitializeComponent();

                //
                // photoViewerControl
                //
                this.photoViewerControl = new LibSys.PhotoViewerControl();
                this.viewerPanel.Controls.AddRange(new System.Windows.Forms.Control[] { this.photoViewerControl});
                this.photoViewerControl.Dock = System.Windows.Forms.DockStyle.Fill;
                this.photoViewerControl.Name = "photoViewerControl";
                this.photoViewerControl.photoDescr = m_photoDescr;
                this.photoViewerControl.TabIndex = 1;
                this.photoViewerControl.Cursor = Cursors.Hand;
                this.photoViewerControl.Click += new System.EventHandler(this.photoViewerControl_Click);

                photoPropertiesPopup = new PhotoPropertiesPopup();

                setPhotoDetail();

                fitToSizeCheckBox.Checked = Project.photoFitToSize;
                keepInViewCheckBox.Checked = m_keepInView;

                if(Project.fitsScreen(Project.photoFullSizeX, Project.photoFullSizeY, Project.photoFullSizeWidth, Project.photoFullSizeHeight))
                {
                    inResize = true;
                    this.Location = new Point(Project.photoFullSizeX, Project.photoFullSizeY);
                    this.ClientSize = new System.Drawing.Size(Project.photoFullSizeWidth, Project.photoFullSizeHeight);		// causes Resize()
                }

                setupButtons();

                Project.setDlgIcon(this);
            }
        }
Пример #3
0
        public DlgPhotoDraw(Waypoint wpt, PhotoDescr photoDescr)
        {
            if(photoDescr != null)
            {
                // from DlgPhotoFullSize, wpt may be null
                m_photoDescr = PhotoDescr.FromPhotoDescr(photoDescr);		// with null image
                m_photoDescr.imageDisposable = false;
                m_photoDescr.ensureOriginalImageExists();		// local will be still invoked if not a gallery
            }
            else
            {
                // from right-click on a waypoint; wpt must be non-null
                try
                {
                    m_photoDescr = PhotoDescr.FromThumbnail(wpt.ThumbSource);
                    m_photoDescr.imageDisposable = false;
                    m_photoDescr.ensureOriginalImageExists();		// local will be still invoked if not a gallery
                }
                    // An invalid image will throw an OutOfMemoryException
                    // exception
                catch (OutOfMemoryException)
                {
                    throw new Exception("Corrupted image file?");
                }
            }
            originalOrientation = m_photoDescr.Orientation;
            m_photoDescr.Orientation = 1;			// will force display to actual orientation, no adjustment
            originalBitmap = new Bitmap(m_photoDescr.image);
            whRatio = (double)originalBitmap.Width / (double)originalBitmap.Height;

            foreach(PropertyItem item in m_photoDescr.image.PropertyItems)
            {
                //string str = "" + item.Type + ": " + item.Id + "=" + item.Value;
                //LibSys.StatusBar.Trace(str);
                originalBitmap.SetPropertyItem(item);
            }

            m_wpt = wpt;

            InitializeComponent();

            addExifCoordsCheckBox.Enabled = (m_wpt != null);
            addExifCoordsCheckBox.Checked = m_addExifCoords;

            this.linkToWptLinkLabel.Enabled = (m_wpt == null || m_wpt.TrackId == -1);

            this.photoViewerControl = new LibSys.PhotoViewerControl();
            this.picturePanel.Controls.AddRange(new System.Windows.Forms.Control[] { this.photoViewerControl});
            //
            // photoViewerControl
            //
            this.photoViewerControl.Dock = System.Windows.Forms.DockStyle.Fill;
            this.photoViewerControl.Name = "photoViewerControl";
            //this.photoViewerControl.photoDescr = null;
            this.photoViewerControl.TabIndex = 1;

            photoViewerControl.fitToSize = m_fitToSize;
            fitToSizeCheckBox.Checked = m_fitToSize;
            this.fitToSizeCheckBox.CheckedChanged += new System.EventHandler(this.fitToSizeCheckBox_CheckedChanged);

            if(m_wpt != null && m_wpt.TrackId != -1)
            {
                timeTptRadioButton.Checked = true;
                this.timePanel.Enabled = true;
            }
            else
            {
                timeExifRadioButton.Checked = true;
                timePanel.Enabled = false;
            }

            setTextTextBox();

            widthTextBox.Text = "" + originalBitmap.Width;		// Y will be set in validation
            widthTextBox_Validating(null, null);

            draw(false);

            if(Project.fitsScreen(m_dlgSizeX, m_dlgSizeY, m_dlgSizeWidth, m_dlgSizeHeight))
            {
                inResize = true;
                this.Location = new Point(m_dlgSizeX, m_dlgSizeY);
                this.ClientSize = new System.Drawing.Size(m_dlgSizeWidth, m_dlgSizeHeight);		// causes Resize()
            }

            // PhotoProperties related:
            // Create an instance of a ListView column sorter and
            // assign it to the _listView control.
            lvwColumnSorter = new ListViewColumnSorter();
            this._listView.ListViewItemSorter = lvwColumnSorter;

            _resultOptions = new ResultOptions();

            // end of PhotoProperties related.

            positionComboBox.SelectedIndex = m_position;
            this.positionComboBox.SelectedIndexChanged += new System.EventHandler(this.positionComboBox_SelectedIndexChanged);

            m_fontSize = (int)Math.Round(Math.Max(originalBitmap.Width / 50.0d, m_fontSize));
            fontNumericUpDown.Value = Math.Min(m_fontSize, fontNumericUpDown.Maximum);

            qualityNumericUpDown.Value = Project.photoSaveQuality;
            this.qualityNumericUpDown.ValueChanged += new System.EventHandler(this.qualityNumericUpDown_ValueChanged);

            applyTextCheckBox.Checked = true;
            pickColorButton.BackColor = m_color;
            pickBgColorButton.BackColor = m_bgColor;
            this.useBgColorCheckBox.Checked = m_useBgColor;

            this.Text += " - " + m_photoDescr.imageName;

            switch(originalOrientation)
            {
                    // see PhotoDescr.cs for EXIF orientation codes:
            //				case 4:
            //					//thumb.RotateFlip(RotateFlipType.Rotate180FlipNone);
            //					break;
                case 8:
                    this.rotate270RadioButton.Checked = true;
                    //thumb.RotateFlip(RotateFlipType.Rotate270FlipNone);
                    break;
                case 6:
                    this.rotate90RadioButton.Checked = true;
                    //thumb.RotateFlip(RotateFlipType.Rotate90FlipNone);
                    break;
                default:
                    this.rotate0RadioButton.Checked = true;
                    break;
            }

            this.saveButton.Enabled = false;
            this.previewLinkLabel.Enabled = false;

            Project.setDlgIcon(this);
        }
Пример #4
0
        // 0 - asooc.tab,  1 - trackpoints tab,  2 - unrelated tab,   3 - options tab
        public DlgPhotoManager(int mode)
        {
            if(This != null)
            {
                This.Dispose();
            }

            This = this;
            m_mode = mode;

            Project.photoModeReprocess = false;
            Project.photoSelectPhotoMode = 0;

            DlgPhotoFullSize.DisposeIfUp();

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            setTimeShiftButton.Enabled = false;		// note: also serves as a flag
            origButtonBackColor = saveTimeShiftButton.BackColor;

            this.SuspendLayout();

            hintLabel.Text = hintText;

            this.timeZoneComboBox.Items.AddRange(MyTimeZone.TimeZones);

            // making photoViewerControl as dumb VS Designer removes it:
            this.photoViewerControl = new LibSys.PhotoViewerControl();
            this.photoViewerPanel.Controls.AddRange(new System.Windows.Forms.Control[] { this.photoViewerControl });
            this.photoViewerControl.Dock = DockStyle.Fill;
            this.photoViewerControl.Cursor = System.Windows.Forms.Cursors.Hand;
            //this.photoViewerControl.Location = new System.Drawing.Point(336, 176);
            this.photoViewerControl.Name = "photoViewerControl";
            this.photoViewerControl.photoDescr = null;
            //this.photoViewerControl.Size = new System.Drawing.Size(224, 184);
            this.photoViewerControl.TabIndex = 112;
            this.photoViewerControl.Click += new System.EventHandler(this.photoViewerControl_Click);

            // making myFileOrFolder control as dumb VS Designer removes it:
            this.myFileOrFolder = new LibSys.MyFileOrFolder();
            this.myFileOrFolder.Dock = DockStyle.Fill;
            this.fileOrFolderPanel.Controls.Add(this.myFileOrFolder);
            this.myFileOrFolder.Name = "myFileOrFolder";
            this.myFileOrFolder.browseFileButton.Click += new System.EventHandler(this.browseFileButton_Click);
            this.myFileOrFolder.browseFolderButton.Click += new System.EventHandler(this.browseFolderButton_Click);
            this.myFileOrFolder.verifyGalleryButton.Click += new System.EventHandler(this.verifyGalleryButton_Click);
            this.myFileOrFolder.importFileButton.Click += new System.EventHandler(this.importFileButton_Click);
            this.myFileOrFolder.importFolderButton.Click += new System.EventHandler(this.importFolderButton_Click);
            this.myFileOrFolder.importGalleryButton.Click += new System.EventHandler(this.importGalleryButton_Click);
            this.myFileOrFolder.tabControl1.SelectedIndexChanged += new System.EventHandler(this.myFileOrFolder_ModeChanged);

            configureReprocessButton();		// "Reprocess File" or "Reprocess Folder"

            this.ResumeLayout(true);

            // whatever is needed to initialize checkboxes etc:
            keepInViewCheckBox.Checked = m_keepInView;
            zoomInCheckBox.Checked = m_doZoomIn;

            configureTimeshiftChoices(false, true);
            shiftTypeComboBox.SelectedIndex = m_photoTimeShiftTypeSelected;

            if(Project.photoGalleryPictureSize >= Project.photoGalleryPictureSizes.Length)
            {
                Project.photoGalleryPictureSize = 2;
            }
            pictureSizeComboBox.SelectedIndex = Project.photoGalleryPictureSize;

            this.trackpointsDataGrid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.trackpointsDataGrid_MouseUp);

            this.unrelatedDataGrid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.unrelatedDataGrid_MouseUp);

            Project.setDlgIcon(this);
        }