コード例 #1
0
        private void FillImageList()
        {
            try
            {
                m_imageList.ImageSize = g_pictureSize;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            int i = 0;

            foreach (string trainPersonImageInfo in m_personImagesInfo)
            {

                ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();

                string path =trainPersonImageInfo;

                
                Image image = Image.FromFile(path);

//                 ImageList imageList = new ImageList();
//                 imageList.ImageSize = g_pictureSize;
//                 imageList.Images.Add(image);
                m_imageList.Images.Add(image);

                PictureBoxLZ pictureBox = new PictureBoxLZ();
                pictureBox.AutoSize = false;
                pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
                pictureBox.Image = image;
                pictureBox.m_name = trainPersonImageInfo.Substring(trainPersonImageInfo.LastIndexOf("\\")+1);
                
                pictureBox.Cursor = Cursors.Hand;
                pictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.鼠标滑过图片);
                pictureBox.MouseLeave += new EventHandler(this.鼠标离开图片);
                pictureBox.Click += new System.EventHandler(this.鼠标点击图片);
                pictureBox.DoubleClick += new System.EventHandler(this.鼠标双击图像);
                m_pictureBoxList.Add(pictureBox);

                //imaAndPicbox.imageList = imageList;
                imaAndPicbox.pictureBox = pictureBox;
                baseList.Add(imaAndPicbox);
                old_baseList.Add(imaAndPicbox);
                i++;
            }
            //old_baseList = baseList;
            name_label.AutoSize = true;
            name_label.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            name_label.Location = new System.Drawing.Point(240, 61);
            name_label.Size = new System.Drawing.Size(0, 28);
            this.label_name.Text = m_name;
        }
コード例 #2
0
        private void FillImageList()
        {
            try
            {
                m_imageList.ImageSize = g_pictureSize;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            int i = 0;

            foreach (string trainPersonImageInfo in m_personImagesInfo)
            {
                ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();

                string path = trainPersonImageInfo;


                Image image = Image.FromFile(path);

//                 ImageList imageList = new ImageList();
//                 imageList.ImageSize = g_pictureSize;
//                 imageList.Images.Add(image);
                m_imageList.Images.Add(image);

                PictureBoxLZ pictureBox = new PictureBoxLZ();
                pictureBox.AutoSize = false;
                pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
                pictureBox.Image    = image;
                pictureBox.m_name   = trainPersonImageInfo.Substring(trainPersonImageInfo.LastIndexOf("\\") + 1);

                pictureBox.Cursor       = Cursors.Hand;
                pictureBox.MouseMove   += new System.Windows.Forms.MouseEventHandler(this.标滑过图片);
                pictureBox.MouseLeave  += new EventHandler(this.标离开图片);
                pictureBox.Click       += new System.EventHandler(this.标点击图片);
                pictureBox.DoubleClick += new System.EventHandler(this.标双击图像);
                m_pictureBoxList.Add(pictureBox);

                //imaAndPicbox.imageList = imageList;
                imaAndPicbox.pictureBox = pictureBox;
                baseList.Add(imaAndPicbox);
                old_baseList.Add(imaAndPicbox);
                i++;
            }
            //old_baseList = baseList;
            name_label.AutoSize  = true;
            name_label.Font      = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            name_label.Location  = new System.Drawing.Point(240, 61);
            name_label.Size      = new System.Drawing.Size(0, 28);
            this.label_name.Text = m_name;
        }
コード例 #3
0
        private void FillImageList()
        {
            try
            {
                m_imageList.ImageSize = g_pictureSize;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            int i = 0;

            foreach (string name in name_list)
            {
                ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();

                string path = m_faceBase.m_rootPath + name;

                path += "\\" + name + "0.bmp";
                Image image = Image.FromFile(path, true);

//                 ImageList imageList = new ImageList();
//                 imageList.ImageSize = g_pictureSize;
//                 imageList.Images.Add(image);
                m_imageList.Images.Add(image);

                PictureBoxLZ pictureBox = new PictureBoxLZ();
                pictureBox.AutoSize = false;
                pictureBox.Location = new Point(100 + i * 115, 100);
                pictureBox.Size     = new Size(100, 100);
                pictureBox.Size     = g_pictureSize;
                pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
                pictureBox.Image    = image;
                pictureBox.m_name   = name;
                this.Controls.Add(pictureBox);
                pictureBox.Cursor       = Cursors.Hand;
                pictureBox.MouseMove   += new System.Windows.Forms.MouseEventHandler(this.标滑过图片);
                pictureBox.MouseLeave  += new System.EventHandler(this.标离开图片);
                pictureBox.Click       += new System.EventHandler(this.标点击图片);
                pictureBox.DoubleClick += new System.EventHandler(this.标双击图像);
                m_pictureBoxList.Add(pictureBox);

                //imaAndPicbox.imageList = imageList;
                imaAndPicbox.pictureBox = pictureBox;
                baseList.Add(imaAndPicbox);
                i++;
            }
            name_label.AutoSize = true;
            name_label.Font     = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            name_label.Location = new System.Drawing.Point(240, 61);
            name_label.Size     = new System.Drawing.Size(0, 28);
        }
コード例 #4
0
        private void FillImageList()
        {           
            try
            {
                m_imageList.ImageSize = g_pictureSize;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            int i = 0;
            foreach (string name in name_list)
            {
                
                ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();
                
                string path = m_faceBase.m_rootPath + name;

                path += "\\" + name + "0.bmp";
                Image image = Image.FromFile(path, true);

//                 ImageList imageList = new ImageList();
//                 imageList.ImageSize = g_pictureSize;
//                 imageList.Images.Add(image);             
                m_imageList.Images.Add(image);

                PictureBoxLZ pictureBox = new PictureBoxLZ();
                pictureBox.AutoSize = false;
                pictureBox.Location = new Point(100 + i * 115, 100);
                pictureBox.Size = new Size(100,100);
                pictureBox.Size = g_pictureSize;  
                pictureBox.SizeMode=PictureBoxSizeMode.Zoom;           
                pictureBox.Image=image;
                pictureBox.m_name = name;
                this.Controls.Add(pictureBox);
                pictureBox.Cursor = Cursors.Hand; 
                pictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.鼠标滑过图片);
                pictureBox.MouseLeave += new System.EventHandler(this.鼠标离开图片);
                pictureBox.Click += new System.EventHandler(this.鼠标点击图片);
                pictureBox.DoubleClick += new System.EventHandler(this.鼠标双击图像);
                m_pictureBoxList.Add(pictureBox);

                //imaAndPicbox.imageList = imageList;
                imaAndPicbox.pictureBox = pictureBox;
                baseList.Add(imaAndPicbox);
                i++;
            }
            name_label.AutoSize = true;
            name_label.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            name_label.Location = new System.Drawing.Point(240, 61);
            name_label.Size = new System.Drawing.Size(0, 28);
        }
コード例 #5
0
        private void AddOnePicbox(string newPicPath)
        {
            if (newPicPath == null && newPicPath == "")
            {
                return;
            }
            Image image = Image.FromFile(newPicPath);

//             ImageList imageList = new ImageList();
//             imageList.ImageSize = new Size(100,100);
//             imageList.Images.Add(image);
            m_imageList.Images.Add(image);
            PictureBoxLZ pictureBox = new PictureBoxLZ();

            pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
            pictureBox.Size     = new Size(100, 100);
            pictureBox.m_name   = newPicPath.Substring(newPicPath.LastIndexOf("\\") + 1);
            Size windowSize = this.Size;
            int  width      = windowSize.Width;
            int  height     = windowSize.Height;

            pictureBox.Image = image;
            if (m_lastPicboxLocation.Y < 100)
            {
                m_lastPicboxLocation = new Point(-90, 100);
            }
            if (m_lastPicboxLocation.X > width - 235)
            {
                pictureBox.Location = new Point(25, m_lastPicboxLocation.Y + 150 - m_delta);
            }
            else
            {
                pictureBox.Location = new Point(m_lastPicboxLocation.X + 115, m_lastPicboxLocation.Y - m_delta);
            }
            m_lastPicboxLocation    = new Point(pictureBox.Location.X, pictureBox.Location.Y + m_delta);
            pictureBox.Cursor       = Cursors.Hand;
            pictureBox.MouseMove   += new System.Windows.Forms.MouseEventHandler(this.标滑过图片);
            pictureBox.MouseLeave  += new EventHandler(this.标离开图片);
            pictureBox.Click       += new System.EventHandler(this.标点击图片);
            pictureBox.DoubleClick += new System.EventHandler(this.标双击图像);
            m_pictureBoxList.Add(pictureBox);

            h_label.Location = new Point(25, pictureBox.Location.Y + 150);

            this.Controls.Add(pictureBox);

            ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();

            //imaAndPicbox.imageList = imageList;
            imaAndPicbox.pictureBox = pictureBox;
            baseList.Add(imaAndPicbox);
        }
コード例 #6
0
        private void AddOnePicbox(string newPersonName)
        {
            string newPersonPicPath = m_faceBase.m_rootPath + newPersonName + "\\" + newPersonName + "0.bmp";
            Image  image            = Image.FromFile(newPersonPicPath);

//             ImageList imageList = new ImageList();
//             imageList.ImageSize = new Size(100, 100);
//             imageList.Images.Add(image);
            m_imageList.Images.Add(image);

            PictureBoxLZ pictureBox = new PictureBoxLZ();

            pictureBox.Size   = new Size(100, 100);
            pictureBox.m_name = newPersonName;
            Size windowSize = this.Size;
            int  width      = windowSize.Width;
            int  height     = windowSize.Height;

            pictureBox.Image = image;
            if (m_lastPicboxLocation.X > width - 235)
            {
                pictureBox.Location = new Point(25, m_lastPicboxLocation.Y + 150 - m_delta);
            }
            else
            {
                pictureBox.Location = new Point(m_lastPicboxLocation.X + 115, m_lastPicboxLocation.Y - m_delta);
            }
            m_lastPicboxLocation    = new Point(pictureBox.Location.X, pictureBox.Location.Y + m_delta);
            pictureBox.Cursor       = Cursors.Hand;
            pictureBox.MouseMove   += new System.Windows.Forms.MouseEventHandler(this.标滑过图片);
            pictureBox.MouseLeave  += new EventHandler(this.标离开图片);
            pictureBox.Click       += new System.EventHandler(this.标点击图片);
            pictureBox.DoubleClick += new System.EventHandler(this.标双击图像);
            m_pictureBoxList.Add(pictureBox);

            h_label.Location = new Point(25, pictureBox.Location.Y + 150);

            this.Controls.Add(pictureBox);

            ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();

            //imaAndPicbox.imageList = imageList;
            imaAndPicbox.pictureBox = pictureBox;
            baseList.Add(imaAndPicbox);
        }
コード例 #7
0
ファイル: TrainDlg.cs プロジェクト: cJeek/homeServiceRobot
        private void AddOnePicbox(string newPicPath)
        {
            if (newPicPath==null&&newPicPath=="")
            {
                return;
            }
            Image image = Image.FromFile(newPicPath);
            m_imageList.Images.Add(image);
            PictureBoxLZ pictureBox = new PictureBoxLZ();
            pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
            pictureBox.Size = new Size(100, 100);
            pictureBox.m_name = newPicPath.Substring(newPicPath.LastIndexOf("\\") + 1);
            Size windowSize = this.Size;
            int width = windowSize.Width;
            int height = windowSize.Height;
            pictureBox.Image = image;
            if (m_lastPicboxLocation.Y < 100)
            {
                m_lastPicboxLocation = new Point(-90,100);
            }
            if (m_lastPicboxLocation.X > width - 235)
            {
                pictureBox.Location = new Point(25, m_lastPicboxLocation.Y + 150-m_delta);
            }
            else
            {
                pictureBox.Location = new Point(m_lastPicboxLocation.X + 115, m_lastPicboxLocation.Y-m_delta);
            }
            m_lastPicboxLocation = new Point(pictureBox.Location.X,pictureBox.Location.Y+m_delta);
            pictureBox.Cursor = Cursors.Hand;
            pictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.鼠标滑过图片);
            pictureBox.MouseLeave += new EventHandler(this.鼠标离开图片);
            pictureBox.Click += new System.EventHandler(this.鼠标点击图片);
            pictureBox.DoubleClick += new System.EventHandler(this.鼠标双击图像);
            m_pictureBoxList.Add(pictureBox);

            h_label.Location = new Point(25, pictureBox.Location.Y + 150);

            this.Controls.Add(pictureBox);

            ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();
            //imaAndPicbox.imageList = imageList;
            imaAndPicbox.pictureBox = pictureBox;
            baseList.Add(imaAndPicbox);
        }
コード例 #8
0
        private void AddOnePicbox(string newPersonName)
        {
            string newPersonPicPath = m_faceBase.m_rootPath + newPersonName + "\\" + newPersonName + "0.bmp";
            Image image = Image.FromFile(newPersonPicPath);
//             ImageList imageList = new ImageList();
//             imageList.ImageSize = new Size(100, 100);
//             imageList.Images.Add(image);
            m_imageList.Images.Add(image);

            PictureBoxLZ pictureBox = new PictureBoxLZ();
            pictureBox.Size = new Size(100, 100);
            pictureBox.m_name = newPersonName;
            Size windowSize = this.Size;
            int width = windowSize.Width;
            int height = windowSize.Height;
            pictureBox.Image = image;
            if (m_lastPicboxLocation.X > width - 235)
            {
                pictureBox.Location = new Point(25, m_lastPicboxLocation.Y + 150 - m_delta);
            }
            else
            {
                pictureBox.Location = new Point(m_lastPicboxLocation.X + 115, m_lastPicboxLocation.Y - m_delta);
            }
            m_lastPicboxLocation = new Point(pictureBox.Location.X, pictureBox.Location.Y + m_delta);
            pictureBox.Cursor = Cursors.Hand;
            pictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.鼠标滑过图片);
            pictureBox.MouseLeave += new EventHandler(this.鼠标离开图片);
            pictureBox.Click += new System.EventHandler(this.鼠标点击图片);
            pictureBox.DoubleClick += new System.EventHandler(this.鼠标双击图像);
            m_pictureBoxList.Add(pictureBox);

            h_label.Location = new Point(25, pictureBox.Location.Y + 150);

            this.Controls.Add(pictureBox);

            ImageAndPicturebox imaAndPicbox = new ImageAndPicturebox();
            //imaAndPicbox.imageList = imageList;
            imaAndPicbox.pictureBox = pictureBox;
            baseList.Add(imaAndPicbox);
        }