Esempio n. 1
0
        void UpdateListBoxFeatures()
        {
            PeopleListBoxColection.Items.Clear();
            foreach (string name in StaticAlbum.ShowPeopleNames())
            {
                PeopleListBoxColection.Items.Add(name);
            }

            LabelListBoxColection.Items.Clear();
            foreach (string name in StaticAlbum.ShowLabelNames())
            {
                LabelListBoxColection.Items.Add(name);
            }

            PictureLabelListBox.Items.Clear();
            foreach (string name in StaticPicture.ShowLabelListPic())
            {
                PictureLabelListBox.Items.Add(name);
            }

            PicturePeopleListBox.Items.Clear();
            foreach (string name in StaticPicture.ShowPersonListPic())
            {
                PicturePeopleListBox.Items.Add(name);
            }

            TagPeopleListBox.Items.Clear();
            foreach (string name in StaticAlbum.ShowPeopleNames())
            {
                TagPeopleListBox.Items.Add(name);
            }
        }
Esempio n. 2
0
        void importFolder()
        {
            FolderBrowserDialog FBD = new FolderBrowserDialog();

            if (FBD.ShowDialog() == DialogResult.OK)
            {
                string targetDirectory = AppDomain.CurrentDomain.BaseDirectory + "Saves";
                Copy(FBD.SelectedPath, targetDirectory);
                void Copy(string SourceDirectory, string TargetDirectory)
                {
                    var diSource = new DirectoryInfo(SourceDirectory);
                    var diTarget = new DirectoryInfo(TargetDirectory);

                    CopyAll(diSource, diTarget);
                }

                void CopyAll(DirectoryInfo source, DirectoryInfo target)
                {
                    Directory.CreateDirectory(target.FullName);
                    // Copy each file into the new directory.
                    foreach (FileInfo fi in source.GetFiles())
                    {
                        Image    file = Image.FromFile(fi.FullName.ToString());
                        Bitmap   bmp  = new Bitmap(file.Width, file.Height);
                        Graphics g    = Graphics.FromImage(bmp);
                        g.DrawImage(file, 0, 0, file.Width, file.Height);
                        string  name = fi.Name.ToString();
                        Picture pic  = new Picture(name, bmp, ImportPictureFileDialog.FileName.ToString());
                        StaticAlbum.AddPic(pic);
                        fi.CopyTo(Path.Combine(target.FullName, fi.Name), true);
                    }
                }
            }
        }
Esempio n. 3
0
        private void TagPeopleListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string name = TagPeopleListBox.SelectedItem.ToString();
            Person p    = StaticAlbum.SearchPerson(name);

            lblPersonInfo2.Text = p.GetPersonInfo();
        }
Esempio n. 4
0
        private void LbSearchresulltListbox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string  name = lbSearchresulltListbox.SelectedItem.ToString();
            Picture pic  = StaticAlbum.GetPicture(name);

            StaticPicture.CopyActualPicture(pic);
            Update();
        }
Esempio n. 5
0
 void UpdatePictureListBox()
 {
     lbPictureListBox.Items.Clear();
     foreach (string name in StaticAlbum.ShowNames())
     {
         lbPictureListBox.Items.Add(name);
     }
 }
Esempio n. 6
0
 private void LbPictureListBox_MouseHover(object sender, EventArgs e)
 {
     lbPictureListBox.Items.Clear();
     foreach (string name in StaticAlbum.ShowNames())
     {
         lbPictureListBox.Items.Add(name);
     }
 }
Esempio n. 7
0
        private void AllPicsListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string  name = AllPicsListBox.SelectedItem.ToString();
            Picture pic  = StaticAlbum.GetPicture(name);

            LittlePictureBox.Image = pic.Bitmap;
            SelectedPicListBox.Items.Add(AllPicsListBox.SelectedItem);
            StaticAlbum.AddSelecctedPic(name);
        }
Esempio n. 8
0
 private void BtnAddToActualpic_Click(object sender, EventArgs e)
 {
     try
     {
         StaticPicture.AddLabel(StaticAlbum.SearchLabel(LabelListBoxColection.SelectedItem.ToString()));
     }
     catch (NullReferenceException)
     {
     }
 }
Esempio n. 9
0
 private void DelatePersonBtn_Click(object sender, EventArgs e)
 {
     try
     {
         StaticAlbum.DelatePerson(PeopleListBoxColection.SelectedIndex);
         UpdatePeopoleListBox();
     }
     catch (ArgumentOutOfRangeException)
     {
     }
 }
Esempio n. 10
0
        public static (string, List <Picture>) Buscar(string Search)
        {
            string[]      ASearchs = Search.Split(' ');
            List <string> searchs  = new List <string>();

            foreach (string s in ASearchs)
            {
                searchs.Add(s);
            }

            int            c = 0;
            List <Picture> search;
            PictureList    temporalpiclist = new PictureList();
            List <string>  notFound        = new List <string>();

            notFound.Add("Resultados no encontrados");
            foreach (string lb in searchs)
            {
                if (c == 0)
                {
                    search = StaticAlbum.Search(lb);
                    if (search.Count == 0)
                    {
                        notFound.Add(lb);
                        continue;
                    }
                    temporalpiclist.AddListOfPics(search);
                    c++;
                }
                search = temporalpiclist.Search(lb);
                if (search.Count == 0)
                {
                    notFound.Add(lb);
                    continue;
                }
                temporalpiclist = new PictureList();
                temporalpiclist.AddListOfPics(search);
            }
            search = temporalpiclist.Copy();

            string Message = "";

            foreach (string word in notFound)
            {
                Message += (word + " ");
            }

            if (notFound.Count() == 1)
            {
                Message = "";
            }
            return(Message, search);
        }
Esempio n. 11
0
 private void DeleteSelectedPicBtn_Click(object sender, EventArgs e)
 {
     try
     {
         UpdateListPicturebox();
         StaticAlbum.DelatePic(SelectedPicListBox.SelectedIndex);
         UpdateListBox();
     }
     catch (ArgumentOutOfRangeException)
     {
     }
 }
Esempio n. 12
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         StaticPicture.BmpCopy = Tools.SlideShowRandomCollage(StaticAlbum.GetSelectedBitmaps(), StaticPicture.BmpCopy);
         Update();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("No picture loaded");
     }
 }
Esempio n. 13
0
 private void SideUnionBtn_Click(object sender, EventArgs e)
 {
     try
     {
         StaticPicture.BmpCopy = Filters.Combine(StaticAlbum.GetSelectedBitmaps());
         Update();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("No picture loaded");
     }
 }
Esempio n. 14
0
 private void AllPicsListBox_MouseHover(object sender, EventArgs e)
 {
     AllPicsListBox.Items.Clear();
     foreach (string name in StaticAlbum.ShowNames())
     {
         AllPicsListBox.Items.Add(name);
     }
     SelectedPicListBox.Items.Clear();
     foreach (string name in StaticAlbum.ShowSelectedNames())
     {
         SelectedPicListBox.Items.Add(name);
     }
 }
Esempio n. 15
0
 private void SelectedPicListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string  name = SelectedPicListBox.SelectedItem.ToString();
         Picture pic  = StaticAlbum.GetPicture(name);
         LittlePictureBox.Image = pic.Bitmap;
         StaticAlbum.DelatePic(SelectedPicListBox.SelectedIndex);
     }
     catch (ArgumentOutOfRangeException)
     {
     }
 }
Esempio n. 16
0
 void UpdateListPicturebox()
 {
     AllPicsListBox.Items.Clear();
     foreach (string name in StaticAlbum.ShowNames())
     {
         AllPicsListBox.Items.Add(name);
     }
     SelectedPicListBox.Items.Clear();
     foreach (string name in StaticAlbum.ShowSelectedNames())
     {
         SelectedPicListBox.Items.Add(name);
     }
 }
Esempio n. 17
0
 private void LbPictureListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string  name = lbPictureListBox.SelectedItem.ToString();
         Picture pic  = StaticAlbum.GetPicture(name);
         StaticPicture.CopyActualPicture(pic);
         Update();
     }
     catch (NullReferenceException)
     {
     }
 }
Esempio n. 18
0
        //------EDIT FEATURES CREATE EVENTS------//
        private void BtnCreateNewLabel_Click(object sender, EventArgs e)
        {
            Label lbl = new Label(textBoxNameLabel.Text);

            StaticAlbum.AddNewLabel(lbl);
            try
            {
                UpdateListBoxFeatures();
            }
            catch (NullReferenceException)
            {
            }
        }
Esempio n. 19
0
        //PICTURE SUBMENU EVENTS-----------------------------------------------------------------------------------------------------------------------

        private void LbPictureListBox_MouseHover(object sender, EventArgs e)
        {
            try
            {
                lbPictureListBox.Items.Clear();
                foreach (string name in StaticAlbum.ShowNames())
                {
                    lbPictureListBox.Items.Add(name);
                }
            }
            catch (NullReferenceException)
            {
            }
        }
Esempio n. 20
0
 private void RandomBtn_Click(object sender, EventArgs e)
 {
     try
     {
         StaticPicture.BmpCopy = Filters.RandomCollage(StaticAlbum.GetSelectedBitmaps());
         Update();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("No picture loaded");
     }
     catch (ArgumentNullException)
     {
         MessageBox.Show("No picture loaded");
     }
 }
Esempio n. 21
0
 private void BtnMosaic2_Click(object sender, EventArgs e)
 {
     try
     {
         StaticPicture.BmpCopy = Filters.TrapMosaic(StaticPicture.BmpCopy, StaticAlbum.GetSelectedBitmaps(), Convert.ToInt32(numericUpDownMosaic2.Value));
         Update();
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("No picture loaded");
     }
     catch (ArgumentNullException)
     {
         MessageBox.Show("No picture loaded");
     }
 }
Esempio n. 22
0
 private void FusionSlideShowBtn_Click(object sender, EventArgs e)
 {
     if (FusionTimer.Enabled)
     {
         FusionTimer.Enabled = false;
         return;
     }
     try
     {
         cont = 0;
         StaticPicture.Bmp = Filters.Combine(StaticAlbum.GetSelectedBitmaps());
         Update();
         FusionTimer.Enabled = true;
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("No picture loaded");
     }
 }
Esempio n. 23
0
        private void BtnCreateNewPerson_Click(object sender, EventArgs e)
        {
            string sex = "";

            if (MaleRadioButton1.Checked)
            {
                sex = "Male";
            }
            if (FemaleRadioButton2.Checked)
            {
                sex = "Female";
            }

            Person p = new Person(textBoxNameNewPerson.Text, sex);

            p.DateOfBirth = dateTimePicker1.Value;
            StaticAlbum.AddNewPerson(p);
            lblPersoninfo3.Text = p.GetPersonInfo();
            UpdateListBoxFeatures();
            UpdatePeopoleListBox();
        }
Esempio n. 24
0
        void openPicture()
        {
            Image        file;
            DialogResult dr = ImportPictureFileDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                file = Image.FromFile(ImportPictureFileDialog.FileName);
                Bitmap   bmp = new Bitmap(file.Width, file.Height);
                Graphics g   = Graphics.FromImage(bmp);
                g.DrawImage(file, 0, 0, file.Width, file.Height);
                string  name = ImportPictureFileDialog.FileName.Split(@"\"[0]).Last <string>().ToString();
                Picture pic  = new Picture(name, bmp, ImportPictureFileDialog.FileName.ToString());
                StaticAlbum.AddPic(pic);
                UpdatePic(pic);
                string target          = AppDomain.CurrentDomain.BaseDirectory + "Saves";
                var    targetDirectory = new DirectoryInfo(target);
                Directory.CreateDirectory(targetDirectory.FullName);
                FileInfo fi = new FileInfo(ImportPictureFileDialog.FileName);
                fi.CopyTo(Path.Combine(targetDirectory.FullName, fi.Name), true);
            }
        }
Esempio n. 25
0
 //-----EDIT FEATURES TAG EVENTS-----//
 private void TagPersonBtn_Click(object sender, EventArgs e)
 {
     try
     {
         string name = TagPeopleListBox.SelectedItem.ToString();
         Person p    = StaticAlbum.SearchPerson(name);
         int    X    = Convert.ToInt32(lblXCoordenadas.Text);
         int    Y    = Convert.ToInt32(lblYCoordenadas.Text);
         StaticPicture.AddPerson(p, X, Y);
         Coordenada co = new Coordenada(X, Y, p);
         try
         {
             StaticPicture.BmpCopy = Filters.TagPerson(co, StaticPicture.BmpCopy, Convert.ToInt32(numericUpDownFaceSize.Value));
             Update();
         }
         catch (NullReferenceException)
         {
             MessageBox.Show("No picture loaded");
         }
     }
     catch (NullReferenceException)
     {
     }
 }
Esempio n. 26
0
 private void SelectedPicListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     StaticAlbum.DelatePic(SelectedPicListBox.SelectedIndex);
 }