Exemplo n.º 1
0
        public bool PrepareCameraView()
        {
            #region 准备主区域视图显示

            bool ret = false;

            ClearCameraView();

            m_pLiveView = new CameraView();
            m_pLiveView.LinkToView(imageView);
            m_pLiveView.m_ptCenter = new Point(PCB.m_pPCB.m_uSizeX / 2, PCB.m_pPCB.m_uSizeY / 2);
            m_pLiveView.m_ptCenter.Offset(PCB.m_pPCB.m_ptOriginOffset);
            m_pLiveView.m_bmp = null;

            return(ret);

            #endregion
        }
Exemplo n.º 2
0
        public bool CopyCameraView(CameraView pView)
        {
            #region 从view复制主区域视图显示

            bool ret = false;

            ClearCameraView();

            m_pLiveView = new CameraView();
            m_pLiveView.LinkToView(imageView);
            m_pLiveView.m_ptCenter = new Point(PCB.m_pPCB.m_uFovSizeX / 2, PCB.m_pPCB.m_uFovSizeY / 2);
            m_pLiveView.m_ptCenter.Offset(PCB.m_pPCB.m_ptOriginOffset);
            m_pLiveView.m_bmp = (Bitmap)pView.m_bmp.Clone();
            m_bmpLive         = (Bitmap)pView.m_bmp.Clone();

            return(ret);

            #endregion
        }
Exemplo n.º 3
0
        public void PrepareCameraView()
        {
            #region 分配视图

            if (PCB.m_pPCB.IsNeedUpdateViewInfo())
            {
                ClearCameraView();

                m_CameraViewList = new List <CameraView>();

                for (int y = 0; y < PCB.m_pPCB.m_yFovNum; y++)
                {
                    Point pt = new Point();
                    pt.Y = PCB.m_pPCB.m_yStep / 2 + y * PCB.m_pPCB.m_yStep + PCB.m_pPCB.m_ptOriginOffset.Y;
                    if (y % 2 == 0)
                    {
                        for (int x = 0; x < PCB.m_pPCB.m_xFovNum; x++)
                        {
                            pt.X = PCB.m_pPCB.m_xStep / 2 + x * PCB.m_pPCB.m_xStep + PCB.m_pPCB.m_ptOriginOffset.X;
                            CameraView pView = new CameraView();
                            pView.LinkToView(imageView);
                            pView.m_iIndex   = m_CameraViewList.Count;
                            pView.m_ptCenter = pt;
                            m_CameraViewList.Add(pView);
                        }
                    }
                    else
                    {
                        for (int x = PCB.m_pPCB.m_xFovNum - 1; x >= 0; x--)
                        {
                            pt.X = PCB.m_pPCB.m_xStep / 2 + x * PCB.m_pPCB.m_xStep + PCB.m_pPCB.m_ptOriginOffset.X;
                            CameraView pView = new CameraView();
                            pView.LinkToView(imageView);
                            pView.m_iIndex   = m_CameraViewList.Count;
                            pView.m_ptCenter = pt;
                            m_CameraViewList.Add(pView);
                        }
                    }
                }
            }
            else
            {
                if (m_CameraViewList != null && m_CameraViewList.Count == PCB.m_pPCB.m_xFovNum * PCB.m_pPCB.m_yFovNum)
                {
                    for (int y = 0; y < PCB.m_pPCB.m_yFovNum; y++)
                    {
                        Point pt = new Point();
                        pt.Y = PCB.m_pPCB.m_yStep / 2 + y * PCB.m_pPCB.m_yStep + PCB.m_pPCB.m_ptOriginOffset.Y;
                        if (y % 2 == 0)
                        {
                            for (int x = 0; x < PCB.m_pPCB.m_xFovNum; x++)
                            {
                                pt.X = PCB.m_pPCB.m_xStep / 2 + x * PCB.m_pPCB.m_xStep + PCB.m_pPCB.m_ptOriginOffset.X;
                                int        index = y * PCB.m_pPCB.m_xFovNum + x;
                                CameraView pView = m_CameraViewList[index];
                                pView.m_ptCenter = pt;
                            }
                        }
                        else
                        {
                            for (int x = PCB.m_pPCB.m_xFovNum - 1; x >= 0; x--)
                            {
                                pt.X = PCB.m_pPCB.m_xStep / 2 + x * PCB.m_pPCB.m_xStep + PCB.m_pPCB.m_ptOriginOffset.X;
                                int        index = y * PCB.m_pPCB.m_xFovNum + (PCB.m_pPCB.m_xFovNum - 1 - x);
                                CameraView pView = m_CameraViewList[index];
                                pView.m_ptCenter = pt;
                            }
                        }
                    }
                }
            }

            #endregion
        }