コード例 #1
0
ファイル: ImageView.cs プロジェクト: CodeMarmot/ImageTagger
        public ImageView( ImageTagger.Core.ImageObj img )
            : this()
        {
            //m_img = img;

            mainImage.ImageLocation = img.FullPath;
        }
コード例 #2
0
        private void search_button_Click(object sender, EventArgs e)
        {// Begins identification on button click.
            //Creates new image tagger object and inputs user path through the GetTags method
            ImageTagger animalImageTagger = new ImageTagger();
            List <Tag>  tags = animalImageTagger.GetTagsForImage(textBoxText);

            //creates new tag filter and then runs the tag list through it
            TagFilter  filter       = new TagFilter();
            List <Tag> filteredTags = filter.Filter(tags);

            foreach (Tag tag in tags)
            {
                if (tag.name == "cat")
                {
                    checkBox2.Checked = true;
                }
                if (tag.name == "dog")
                {
                    checkBox1.Checked = true;
                }
                if (tag.name == "bird")
                {
                    checkBox3.Checked = true;
                }
            }
        }
コード例 #3
0
		/*
		protected override CreateParams CreateParams
		{
			get
			{
				CreateParams cp = base.CreateParams;
				cp.ExStyle |= 0x02000000;  // Turn on WS_EX_COMPOSITED
				return cp;
			}
		}
		*/

		public ThumbnailImage( ImageTagger.Core.ImageObj img ) : this()
		{
#if TRACE
			log.ConditionalTrace( "{0} creating ThumbnailImage control ", img.FullPath );
#endif
			o_img = img;
			this.Tag = o_img.FullPath;

			//display filename
			this.boxLabel.Text = System.IO.Path.GetFileName( o_img.FullPath );
		}
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            AnimalIdentifier_Base.TagReader find = new AnimalIdentifier_Base.TagReader();
            ImageTagger item = new ImageTagger();
            List <Tag>  tags = item.GetTagsForImage(Grab_Path.Text);

            foreach (Tag tag in tags)
            {
                find.Polymorphic(find.check_Dog, tag);
                find.Polymorphic(find.check_Cat, tag);
                find.Polymorphic(find.check_Bird, tag);
            }

            Found_dog.Checked = find.check_Dog.Is_found;

            //if (find.check_Dog.Is_found == true)
            //    Found_dog.Checked = true;
            //if (find.check_Cat.Is_found == true)
            //    Found_cat.Checked = true;
            //if (find.check_Bird.Is_found == true)
            //    Found_bird.Checked = true;

            //if (Found_dog.Checked == Found_cat.Checked && Found_dog.Checked == true)
            //{
            //    if (Found_dog == Found_bird)
            //        View_output.Text = "A Bird, A cat and A dog are in this picture";
            //    else
            //        View_output.Text = "A dog and a cat are in this picture";
            //}
            //else if (Found_bird.Checked == Found_cat.Checked && Found_cat.Checked == true)
            //    View_output.Text = "A bird and a cat are in this picture";
            //else if (Found_dog.Checked == Found_bird.Checked && Found_bird.Checked == true)
            //    View_output.Text = "A bird and a dog are in this picture";
            //else if (Found_dog.Checked)
            //    View_output.Text = "A dog is in this picture";
            //else if (Found_cat.Checked)
            //    View_output.Text = "A cat is in this picture";
            //else if (Found_bird.Checked)
            //    View_output.Text = "A bird is in this picture";
            //else
            //    View_output.Text = "This picture contains no animals";
        }