Ejemplo n.º 1
0
        /// <summary>
        /// Constructor.  The image provided will be automatically displayed when the form is shown.
        /// </summary>
        /// <param name="image">The image to be displayed when the window is shown.</param>
        public FormImageEdit( SourceImage image )
        {
            InitializeComponent();

            //setup the window and variables
            sourceImage = image;
            labelFileNameData.Text = sourceImage.name;
            this.Text += " ( " + sourceImage.name + " ) ";
            sourceImageOrganizer = SourceImageOrganizer.getInstance();

            //setup the ImageBox and the picture it will display
            imageBox1 = new ImageBox();
            imageBox1.Image = new Image<Bgr, byte>(sourceImage.path);
            imageBox1.SizeMode = PictureBoxSizeMode.AutoSize;
            imageBox1.FunctionalMode = ImageBox.FunctionalModeOption.Minimum;
            imageBox1.MouseDown += new MouseEventHandler(imageBox1_MouseDown);
            imageBox1.MouseUp += new MouseEventHandler(imageBox1_MouseUp);

            //setup the image panel, add the image
            //this is necessary for scroll bars
            panelImagePanel.AutoScroll = true;
            panelImagePanel.Controls.Add(imageBox1);

            showHistogram();
        }
Ejemplo n.º 2
0
        private void buttonEditImage_Click(object sender, EventArgs e)
        {
            SourceImage image = (dataGridImages.SelectedCells[1].Value as SourceImage);

            formImageEdit = new FormImageEdit(image);

            formImageEdit.ShowDialog();
        }
Ejemplo n.º 3
0
        public void addImage( string path, string imageName )
        {
            SourceImage newImage = new SourceImage(path, imageName);
            XmlElement newNode = imageDoc.CreateElement("image");

            newNode.SetAttribute("name", imageName);
            newNode.SetAttribute("path", path);

            imageRoot.AppendChild(newNode);

            imageDoc.Save(Constants.FILE_IMAGES);
        }
Ejemplo n.º 4
0
        public FormImageEdit(SourceImage image)
        {
            InitializeComponent();

            sourceImage            = image;
            labelFileNameData.Text = sourceImage.name;
            this.Text += " ( " + sourceImage.name + " ) ";

            //TODO - KR - Remove when finished
            //also remove the text box, label
            textBoxPath.Text = sourceImage.path;
        }
Ejemplo n.º 5
0
        public void addImage(string path, string imageName)
        {
            SourceImage newImage = new SourceImage(path, imageName);
            XmlElement  newNode  = imageDoc.CreateElement("image");

            newNode.SetAttribute("name", imageName);
            newNode.SetAttribute("path", path);

            imageRoot.AppendChild(newNode);

            imageDoc.Save(Constants.FILE_IMAGES);
        }
Ejemplo n.º 6
0
        public FormImageEdit( SourceImage image )
        {
            InitializeComponent();

            sourceImage = image;
            labelFileNameData.Text = sourceImage.name;
            this.Text += " ( " + sourceImage.name + " ) ";

            //TODO - KR - Remove when finished
            //also remove the text box, label
            textBoxPath.Text = sourceImage.path;
        }
Ejemplo n.º 7
0
        public Dictionary<string, SourceImage> getImageList()
        {
            Dictionary<string, SourceImage> list = new Dictionary<string, SourceImage>();

            SourceImage newImage;

            foreach (XmlElement node in imageRoot.ChildNodes)
            {
                newImage = new SourceImage(node.GetAttribute( "path" ), node.GetAttribute("name"));

                list.Add(newImage.name, newImage);
            }

            return list;
        }
Ejemplo n.º 8
0
        public Dictionary <string, SourceImage> getImageList()
        {
            Dictionary <string, SourceImage> list = new Dictionary <string, SourceImage>();

            SourceImage newImage;

            foreach (XmlElement node in imageRoot.ChildNodes)
            {
                newImage = new SourceImage(node.GetAttribute("path"), node.GetAttribute("name"));

                list.Add(newImage.name, newImage);
            }

            return(list);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Constructor.  The image provided will be used to search
        /// for tags applied to the image.
        /// </summary>
        /// <param name="image">The image the tags apply to.</param>
        public FormImageTags(SourceImage image)
        {
            InitializeComponent();

            //set the source image
            sourceImage = image;

            //get a TagOrganizer instance
            tagOrganizer = TagOrganizer.getInstance();

            //add closing handler
            this.FormClosing += new FormClosingEventHandler(FormImageTags_FormClosing);

            //get new taglist
            refreshTagList();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Constructor.  The image provided will be used to search
        /// for tags applied to the image.
        /// </summary>
        /// <param name="image">The image the tags apply to.</param>
        public FormImageTags( SourceImage image )
        {
            InitializeComponent();

            //set the source image
            sourceImage = image;

            //get a TagOrganizer instance
            tagOrganizer = TagOrganizer.getInstance();

            //add closing handler
            this.FormClosing += new FormClosingEventHandler(FormImageTags_FormClosing);

            //get new taglist
            refreshTagList();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Adds the specified SourceImage object to the XML file specified in Constants.FILE_IMAGES.
        /// </summary>
        /// <param name="path">The path of the full path of the file, inclduing file name and file extension.</param>
        /// <param name="imageName">The name of the file, including file extension.</param>
        public void addImage( string path, string imageName )
        {
            //Create a new node
            SourceImage newImage = new SourceImage(path, imageName);
            XmlElement newNode = imageDoc.CreateElement("image");

            //set attributes
            newNode.SetAttribute("name", imageName);
            newNode.SetAttribute("path", path);

            //add to the end of the document
            imageRoot.AppendChild(newNode);

            //save!
            imageDoc.Save(Constants.FILE_IMAGES);
        }
        /// <summary>
        /// Adds the specified SourceImage object to the XML file specified in Constants.FILE_IMAGES.
        /// </summary>
        /// <param name="path">The path of the full path of the file, inclduing file name and file extension.</param>
        /// <param name="imageName">The name of the file, including file extension.</param>
        public void addImage(string path, string imageName)
        {
            //Create a new node
            SourceImage newImage = new SourceImage(path, imageName);
            XmlElement  newNode  = imageDoc.CreateElement("image");

            //set attributes
            newNode.SetAttribute("name", imageName);
            newNode.SetAttribute("path", path);

            //add to the end of the document
            imageRoot.AppendChild(newNode);

            //save!
            imageDoc.Save(Constants.FILE_IMAGES);
        }
        public void addImage(string imageName, string path)
        {
            bool exists = false;

            foreach (KeyValuePair <string, SourceImage> kvp in imageList)
            {
                if (kvp.Key.Equals(imageName) || kvp.Value.path.Equals(path))
                {
                    exists = true;
                }
            }

            if (exists != true)
            {
                sourceImageFactory.addImage(path, imageName);

                SourceImage newImage = new SourceImage(path, imageName);
                imageList.Add(imageName, newImage);
            }
        }
Ejemplo n.º 14
0
        public void addImage( string imageName, string path )
        {
            bool exists = false;

            foreach (KeyValuePair<string, SourceImage> kvp in imageList)
            {
                if (kvp.Key.Equals(imageName) || kvp.Value.path.Equals(path))
                {
                    exists = true;
                }
            }

            if (exists != true)
            {
                sourceImageFactory.addImage(path, imageName);

                SourceImage newImage = new SourceImage(path, imageName);
                imageList.Add(imageName, newImage);
            }
        }
        /// <summary>
        /// Creates a SourceImage based on the provided information, and adds it to the
        /// system.  The SourceImageFactory is then called to add the SourceImage
        /// object to the reference file.
        ///
        /// If the image already exists, the image is not added to the system a second
        /// time.
        /// </summary>
        /// <param name="imageName">The full file name of the image to be added, including file extension.</param>
        /// <param name="path">The full path to the image to be added, including file name and file extension.</param>
        public void addImage(string imageName, string path)
        {
            bool exists = false;

            //check if the image exists
            foreach (KeyValuePair <string, SourceImage> kvp in imageList)
            {
                if (kvp.Key.Equals(imageName) || kvp.Value.path.Equals(path))
                {
                    exists = true;
                }
            }

            //if it doesn't exist
            if (exists != true)
            {
                //add a new image to the reference file
                sourceImageFactory.addImage(path, imageName);

                //add the image to the system
                SourceImage newImage = new SourceImage(path, imageName);
                imageList.Add(imageName, newImage);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Creates a SourceImage based on the provided information, and adds it to the
        /// system.  The SourceImageFactory is then called to add the SourceImage
        /// object to the reference file.
        /// 
        /// If the image already exists, the image is not added to the system a second
        /// time.
        /// </summary>
        /// <param name="imageName">The full file name of the image to be added, including file extension.</param>
        /// <param name="path">The full path to the image to be added, including file name and file extension.</param>
        public void addImage( string imageName, string path )
        {
            bool exists = false;

            //check if the image exists
            foreach (KeyValuePair<string, SourceImage> kvp in imageList)
            {
                if (kvp.Key.Equals(imageName) || kvp.Value.path.Equals(path))
                {
                    exists = true;
                }
            }

            //if it doesn't exist
            if (exists != true)
            {
                //add a new image to the reference file
                sourceImageFactory.addImage(path, imageName);

                //add the image to the system
                SourceImage newImage = new SourceImage(path, imageName);
                imageList.Add(imageName, newImage);
            }
        }