예제 #1
0
        public DrawFrame(DesignPanel tD, int width, int height, Image backImage)
        {
            TDPanel = tD;

            this.SetStyle(ControlStyles.Selectable, true);

            InitializeComponent();

            this.BackColor = Color.FromArgb(192, 192, 192);
            this.SetStyle(ControlStyles.Selectable, true);
            this.AutoScroll = false;
            this.Cursor     = Cursors.Arrow;

            DrawPanel          = CreateDrawPanel(tD, width, height, backImage);
            DrawPanel.TabIndex = 0;
            DrawPanel.Select();
            DrawPanel.BackColor = Color.White;

            this.Controls.Add(DrawPanel);
            this.SetLocation();

            //事件初始化

            this.SizeChanged += new EventHandler(DrawFrame_SizeChanged);
            this.DfVScrollBar.ValueChanged += new EventHandler(DfVScrollBar_ValueChanged);
            this.DfHScrollBar.ValueChanged += new EventHandler(DfHScrollBar_ValueChanged);
            this.DfVScrollBar.SmallChange   = 10;
            this.DfHScrollBar.SmallChange   = 10;
        }
예제 #2
0
        /// <summary>
        /// 载入模板数据
        /// </summary>
        /// <param name="tmpltID"></param>
        public void LoadTmplt(TmpltXmlDocument doc)
        {
            try
            {
                HasContentSnip = bool.Parse(doc.DocumentElement.GetAttribute("hasContent"));
            }
            catch (Exception)
            {
                HasContentSnip = false;
            }

            LoadLines(doc);
            LoadRects(doc);
            //DrawPanel.TmpltDoc = doc;
            ((TmpltDrawPanel)DrawPanel).TmpltDoc = doc;
            TmpltDoc = doc;
            DrawPanel.Invalidate();
        }