Exemplo n.º 1
0
        private void InitView()
        {
            if (string.IsNullOrEmpty(Main.Id))
            {
                return;
            }
            ArcFace.Staff staff = new ArcFace.Staff();
            staff = staffs.Find(s => s.StaffID == Main.Id);
            //Panel panel = new Panel();
            var panel = this.panel1;

            panel.AutoSize              = true;
            panel.Dock                  = DockStyle.Fill;
            panel.BackgroundImage       = new Bitmap("C:\\FeatureData\\readydata\\seat.png");
            panel.BackgroundImageLayout = ImageLayout.Center;
            panel.BackColor             = Color.AliceBlue;
            panel.Location              = new Point(0, 0);
            //头像控件
            PictureBox picbox = new PictureBox();

            picbox.Width    = 200;
            picbox.Height   = 200;
            picbox.Image    = new Bitmap("D:\\FeatureData\\Image\\" + staff.StaffID + ".jpeg");
            picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            picbox.Location = new Point(285, 200);
            panel.Controls.Add(picbox);

            //姓名lable标签
            Label label = new Label();

            label.Text      = staff.Name;
            label.BackColor = Color.Brown;
            label.Font      = new Font(FontFamily.Families.First(), (float)40, FontStyle.Bold);
            label.ForeColor = Color.White;
            label.Width     = 300;
            label.Height    = 50;
            label.Location  = new Point(235, 460);
            label.TextAlign = ContentAlignment.MiddleCenter;
            panel.Controls.Add(label);
            //座位号lable标签
            Label seat = new Label();

            seat.Text      = staff.SeatNumber;
            seat.BackColor = Color.White;
            seat.Font      = new Font("", (float)90, FontStyle.Bold);
            seat.Width     = 400;
            seat.Height    = 150;
            seat.Location  = new Point(700, 250);
            seat.TextAlign = ContentAlignment.MiddleCenter;
            panel.Controls.Add(seat);

            this.Controls.Add(panel);
        }
Exemplo n.º 2
0
        private void ShowImg(ArcFace.Staff staff)
        {
            //this._RegisterFeatureData = ArcFace.Api.CacheFaceResults[_RegisterIndex].GetFeatureData();
            //var img = this.VideoPlayer.GetCurrentVideoFrame();
            //var r = ArcFace.Api.CacheFaceResults[_RegisterIndex].Rectangle; r.Inflate((int)(r.Width * 0.5), (int)(r.Height * 0.5));
            //if (r.X < 0)
            //{
            //    r.Width += r.X; r.X = 0;
            //}
            //if (r.Y < 0)
            //{
            //    r.Height += r.Y; r.Y = 0;
            //}
            //var nImg = new Bitmap(r.Width, r.Height);
            //using (var g = Graphics.FromImage(nImg))
            //{
            //    g.DrawImage(img, new Rectangle(0, 0, r.Width, r.Height), r, GraphicsUnit.Pixel);
            //    //g.DrawRectangle(_PenFace, r);
            //}
            //this.pictureBox1.Image = nImg;
            //img.Dispose();

            //staffId
            if (staff != null)
            {
                var nImg = new Bitmap("D:\\FeatureData\\Image\\" + staff.StaffID + ".jpeg");
                this.pictureBox1.Image = nImg;
                this.TextBoxID.Text    = staff.StaffID;
                this.txtName.Text      = staff.Name;
                this.txtTableNum.Text  = staff.SeatNumber;
            }
            else
            {
                this.txtName.Text     = "";
                this.txtTableNum.Text = "";
            }
        }