画中画的实现

 //画中画
        public void pop(PictureBox[] controlCloneVideo)
        {
            Point n = new Point();
            for (int j = 0; j < 8; j++)
            {
                Point p = new Point();
                p.X = 100;                         //定义第一个定点
                p.Y = 100;
                Point u = new Point();
                u.X = 350;                          //定义第二个定点
                u.Y = 100;
                n.X = controlCloneVideo[j].Left;          //获取控件的坐标
                n.Y = controlCloneVideo[j].Top;
                //  n = controlCloneVideo[j].PointToScreen(new Point(0, 0));
               //判断点是否在控件里面
                if (((n.X <= p.X) && (p.X <= controlCloneVideo[j].Width + n.X)) && ((n.Y <= p.Y) && (p.Y <= controlCloneVideo[j].Height + n.Y)))
                {
                    controlCloneVideo[j].Width = 447;
                    controlCloneVideo[j].Height = 420;
                }else if(((n.X <= u.X)&&(u.X <= (n.X + controlCloneVideo[j].Width)))&&((n.Y <= u.Y)&&(u.Y<= (n.Y +controlCloneVideo[j].Height)))){
                    controlCloneVideo[j].Width = 221;
                    controlCloneVideo[j].Height = 206;
                    controlCloneVideo[j].BringToFront();
                }
                else
                {
                    controlCloneVideo[j].Height = -1;
                    controlCloneVideo[j].Width = -1;

                }

            }
        }
画中画的实现_第1张图片

你可能感兴趣的:(c#,测试开发)