示例#1
0
        private void buttonAddImage_Click(object sender, EventArgs e)
        {
            if (tabControl1.SelectedTab == tabPage1)
            {
                return;
            }

            OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog();

            dialog.Filter = "Images (*.png, *.jpg, *.gif)|*.png;*.jpg;*.jpeg;*.gif|All Files|*.*";
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                InputBoxResult r = InputBox.Show("URL:", "Image URL", "", null, false);
                if (r.OK)
                {
                    String    CurrentCategory = tabControl1.SelectedTab.Text;
                    FaceImage Image           = new FaceImage(CurrentCategory, r.Text, dialog.FileName, "");
                    AllFacesControl.SuspendLayout();
                    AllFacesControl.Add(Image);
                    AllFacesControl.ResumeLayout(true);
                    AllFacesControl.Refresh();
                    FaceControls[CurrentCategory].SuspendLayout();
                    FaceControls[CurrentCategory].Add(Image);
                    FaceControls[CurrentCategory].ResumeLayout(true);
                    FaceControls[CurrentCategory].Refresh();

                    this.Refresh();
                }
            }
        }
示例#2
0
        private void buttonAddMultiUrl_Click(object sender, EventArgs e)
        {
            if (tabControl1.SelectedTab == tabPage1)
            {
                return;
            }

            InputBoxResult r = InputBox.Show("Copy-paste URL list from Rightload:", "Image URLs", "", null, true);

            if (r.OK)
            {
                String CurrentCategory = tabControl1.SelectedTab.Text;

                AllFacesControl.SuspendLayout();
                FaceControls[CurrentCategory].SuspendLayout();
                foreach (string url in r.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
                {
                    FaceImage Image = new FaceImage(CurrentCategory, url, "", "");
                    AllFacesControl.Add(Image);
                    FaceControls[CurrentCategory].Add(Image);
                }
                AllFacesControl.ResumeLayout(true);
                AllFacesControl.Refresh();
                FaceControls[CurrentCategory].ResumeLayout(true);
                FaceControls[CurrentCategory].Refresh();

                this.Refresh();
            }
        }
示例#3
0
        public FaceImageControl(FaceImage Face, FaceImageListControl FaceControlParent)
        {
            this.Face = Face;
            this.FaceControlParent = FaceControlParent;
            InitializeComponent();

            SetBounds(0, 0, Face.Face.Width, Face.Face.Height);

            List <MenuItem> menuitems = new List <MenuItem>();

            MenuItem mi;

            mi        = new MenuItem("Edit URL");
            mi.Click += new EventHandler(mi_EditURL_Click);
            menuitems.Add(mi);

            mi        = new MenuItem("Edit Name");
            mi.Click += new EventHandler(mi_EditName_Click);
            menuitems.Add(mi);

            mi        = new MenuItem("Delete");
            mi.Click += new EventHandler(mi_Delete_Click);
            menuitems.Add(mi);


            RightClickMenuItems = menuitems.ToArray();
            RightClickMenu      = new System.Windows.Forms.ContextMenu(RightClickMenuItems);

            ImageAttrs  = new System.Drawing.Imaging.ImageAttributes();
            ColorMatrix = new System.Drawing.Imaging.ColorMatrix();
        }
示例#4
0
        public void Add(FaceImage Face)
        {
            if (ImageList != null)
            {
                ImageList.Add(Face);
            }

            flowLayoutPanel1.SuspendLayout();
            flowLayoutPanel1.Controls.Add(new FaceImageControl(Face, this));
            flowLayoutPanel1.ResumeLayout(true);
            flowLayoutPanel1.Refresh();
        }
示例#5
0
 public void Add(String Category, FaceImage Face)
 {
     if (Categories.Keys.Contains(Category))
     {
         Categories[Category].Add(Face);
     }
     else
     {
         List <FaceImage> List = new List <FaceImage>();
         List.Add(Face);
         Categories.Add(Category, List);
     }
 }
示例#6
0
 internal void Remove(string Category, FaceImage faceImage)
 {
     Categories[Category].Remove(faceImage);
 }