Exemplo n.º 1
0
        public PanelDrawing()
        {
            //SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
            this.DoubleBuffered = true;

            //InitCustomComponent();
            BackgroundImage = new Bitmap(10, 10);
            //image = new Bitmap(this.Width, this.Height);


            imageCustom = new MyImage(Properties.Settings.Default.panel_width, Properties.Settings.Default.panel_heigh);
            //image = new Bitmap(Properties.Settings.Default.panel_width, Properties.Settings.Default.panel_heigh);


            penCustom           = new MyPen(this);
            penCustom.sizeBrush = Properties.Settings.Default.pen_witdh;


            controlPoint = new ControlPoint(7);



            m_MouseDot     = new Mouse_Dot(this);
            m_MouseLine    = new Mouse_Line(this);
            m_MouseRect    = new Mouse_Rectangle(this);
            m_MouseEclipse = new Mouse_Eclipse(this);
            m_MousePolygon = new Mouse_Polygon(this);

            m_MouseRegion = new Mouse_Region(this);


            m_MouseHandler = m_MouseDot;
        }
Exemplo n.º 2
0
        public void SetSharp(DRAW_TYPE type)
        {
            switch (type)
            {
            case DRAW_TYPE.dotSquare:
                m_MouseHandler.End();
                m_MouseHandler      = m_MouseDot;
                m_MouseDot.isSquare = true;
                break;

            case DRAW_TYPE.dotCircle:
                m_MouseHandler.End();
                m_MouseHandler      = m_MouseDot;
                m_MouseDot.isSquare = false;
                break;

            case DRAW_TYPE.line:
                m_MouseHandler.End();
                m_MouseHandler = m_MouseLine;
                break;

            case DRAW_TYPE.rectangle:
                m_MouseHandler.End();
                m_MouseHandler = m_MouseRect;
                break;

            case DRAW_TYPE.eclipse:
                m_MouseHandler.End();
                m_MouseHandler = m_MouseEclipse;
                break;

            case DRAW_TYPE.polygon:
                m_MouseHandler.End();
                m_MouseHandler = m_MousePolygon;
                break;

            case DRAW_TYPE.region:
                m_MouseHandler.End();
                m_MouseHandler = m_MouseRegion;
                break;

            default:
                break;
            }
            Invalidate();
        }