Пример #1
0
        public void draw(Graphics g)
        {
            #region 主区域绘图

            if (imageDoc.m_iEditType == tagModeType.Mode_Normal)
            {
                g.FillRectangle(Brushes.DimGray, m_vrcScreenArea);

                if (m_image.isInitialized())
                {
                    g.drawImage(m_image, m_vrcPCBImageArea);
                }
                else
                {
                }
            }
            else if (imageDoc.m_iEditType == tagModeType.Mode_Edit)
            {
                g.FillRectangle(Brushes.Black, m_vrcScreenArea);

                if (m_image.isInitialized())
                {
                    g.drawImage(m_image, m_vrcPCBImageArea);
                }
                else
                {
                    g.FillRectangle(Brushes.DimGray, m_vrcPCBImageArea);
                }

                if (imageDoc.m_iShowType == tagShowType.Show_Grid)
                {
                    foreach (clsCameraView pView in clsPCB.m_pPCB.m_CameraViewList)
                    {
                        Rectangle rect = pView.getAbsoluteRect();
                        rect = LpToVp(rect);

                        pView.drawScreenRect(g, rect, Color.LightCoral, System.Drawing.Drawing2D.DashStyle.Dash);
                    }
                }
            }

            foreach (clsPart pPart in clsPCB.m_pPCB.m_PartList)
            {
                Rectangle rect = pPart.getAbsoluteRect();
                rect = LpToVp(rect);

                pPart.drawScreenRect(g, rect);
            }

            //g.DrawRectangle(new Pen(Color.RoyalBlue, 5), m_vrcScreenArea);
            g.DrawLine(new Pen(Color.DeepSkyBlue, 1), m_vrcScreenArea.Width / 2, 0, m_vrcScreenArea.Width / 2, m_vrcScreenArea.Height);
            g.DrawLine(new Pen(Color.DeepSkyBlue, 1), 0, m_vrcScreenArea.Height / 2, m_vrcScreenArea.Width, m_vrcScreenArea.Height / 2);

            #endregion
        }
Пример #2
0
        public void draw(Graphics g, Rectangle rect)
        {
            #region 绘图操作

            if (imageDoc != null)
            {
                if (m_image.isInitialized())
                {
                    g.drawImage(m_image, rect);
                }
                else
                {
                    g.FillRectangle((Brush)Brushes.DarkGray, rect);
                }
            }

            #endregion
        }