Esempio n. 1
0
        /// <summary>克隆对象</summary>
        public override DrawObject Clone()
        {
            DrawRectangle w = new DrawRectangle();

            w.objRectangle = this.objRectangle;
            return(w);
        }
Esempio n. 2
0
        public override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            CC.isToolPoint = false;
            CC.ID          = CC.GetNewID();
            DrawRectangle w = new DrawRectangle(e.X, e.Y, 15, 15, Color.Red, CC.ID);

            AddNewObject(w);
            isNewObjectAdded = true;
        }
Esempio n. 3
0
        public override void OnMouseMove(MouseEventArgs e)
        {
            if (isNewObjectAdded == false)
            {
                return;
            }
            int           index = CC.FindObjectIndex(CC.ID);
            DrawRectangle w     = (DrawRectangle)CC.graphicsList[index];

            if (e.Button == MouseButtons.Left)
            {
                int       x    = w.objRectangle.X;
                int       y    = w.objRectangle.Y;
                Rectangle rect = new Rectangle(x, y, e.X - x, e.Y - y);
                w.objRectangle = rect;
            }
            CC.panel.Refresh();
        }