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); } }
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); } } } }
private void TagPeopleListBox_SelectedIndexChanged(object sender, EventArgs e) { string name = TagPeopleListBox.SelectedItem.ToString(); Person p = StaticAlbum.SearchPerson(name); lblPersonInfo2.Text = p.GetPersonInfo(); }
private void LbSearchresulltListbox_SelectedIndexChanged(object sender, EventArgs e) { string name = lbSearchresulltListbox.SelectedItem.ToString(); Picture pic = StaticAlbum.GetPicture(name); StaticPicture.CopyActualPicture(pic); Update(); }
void UpdatePictureListBox() { lbPictureListBox.Items.Clear(); foreach (string name in StaticAlbum.ShowNames()) { lbPictureListBox.Items.Add(name); } }
private void LbPictureListBox_MouseHover(object sender, EventArgs e) { lbPictureListBox.Items.Clear(); foreach (string name in StaticAlbum.ShowNames()) { lbPictureListBox.Items.Add(name); } }
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); }
private void BtnAddToActualpic_Click(object sender, EventArgs e) { try { StaticPicture.AddLabel(StaticAlbum.SearchLabel(LabelListBoxColection.SelectedItem.ToString())); } catch (NullReferenceException) { } }
private void DelatePersonBtn_Click(object sender, EventArgs e) { try { StaticAlbum.DelatePerson(PeopleListBoxColection.SelectedIndex); UpdatePeopoleListBox(); } catch (ArgumentOutOfRangeException) { } }
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); }
private void DeleteSelectedPicBtn_Click(object sender, EventArgs e) { try { UpdateListPicturebox(); StaticAlbum.DelatePic(SelectedPicListBox.SelectedIndex); UpdateListBox(); } catch (ArgumentOutOfRangeException) { } }
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"); } }
private void SideUnionBtn_Click(object sender, EventArgs e) { try { StaticPicture.BmpCopy = Filters.Combine(StaticAlbum.GetSelectedBitmaps()); Update(); } catch (NullReferenceException) { MessageBox.Show("No picture loaded"); } }
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); } }
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) { } }
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); } }
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) { } }
//------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) { } }
//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) { } }
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"); } }
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"); } }
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"); } }
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(); }
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); } }
//-----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) { } }
private void SelectedPicListBox_SelectedIndexChanged(object sender, EventArgs e) { StaticAlbum.DelatePic(SelectedPicListBox.SelectedIndex); }