Esempio n. 1
0
        /// <summary>
        /// 原始界面画图
        /// </summary>
        public static void DrawShap()
        {
            try
            {
                bGrp.Graphics.Clear(Color.Black);

                bGrp.Graphics.Transform = TransformMatrix.initMatrix;

                GraphicsContainer drawContainer = bGrp.Graphics.BeginContainer();
                bGrp.Graphics.ScaleTransform(1 / globalZoomNum, 1 / globalZoomNum);

                foreach (BaseShape item in currentShapes)
                {
                    if (!"Text".Equals(item.ShapeClass))
                    {
                        item.Draw(bGrp.Graphics);
                    }
                }

                if (nowStock.StockForm.Count > 0)
                {
                    foreach (BaseShape item in nowStock.StockForm)
                    {
                        item.Draw(bGrp.Graphics);
                    }
                }

                foreach (BaseModel item in currentPlates)
                {
                    item.Draw(bGrp.Graphics);
                }

                //SnapPointShape.Draw(bGrp.Graphics);

                selectRect.Draw(bGrp.Graphics);

                CoordinateShape.Draw(bGrp.Graphics);

                MouseShape.Draw(bGrp.Graphics);

                bGrp.Graphics.EndContainer(drawContainer);

                //bGrp.Render();

                //bGrp.Dispose(); //这里释放资源,需要重新添加资源

                foreach (BaseShape item in currentShapes)
                {
                    if ("Text".Equals(item.ShapeClass))
                    {
                        item.Draw(bGrp.Graphics);
                    }
                }

                bGrp.Render();
            }
            catch (System.Exception e)
            {
                //MessageBox.Show("show show show");
            }
        }