Exemple #1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            CurrentFigure = 0;
            Templates     = new List <CFigure>();
            FigureNames   = new List <string>();
            Parameters    = new int[8];

            FiguresList  = new CFiguresList();
            DrawingPen   = new Pen(Color.FromArgb(0, 0, 0), 1);
            DrawingBrush = new SolidBrush(Color.FromArgb(255, 255, 255));

            Drawing = new Bitmap(PictureBoxDraw.Width, PictureBoxDraw.Height);
            Canvas  = Graphics.FromImage(Drawing);

            Templates.Add(CRectangle.CreateTemplate());
            FigureNames.Add("Прямоугольник");
            Templates.Add(CEllipse.CreateTemplate());
            FigureNames.Add("Эллипс");
            Templates.Add(CLine.CreateTemplate());
            FigureNames.Add("Линия");
            Templates.Add(CTrapezium.CreateTemplate());
            FigureNames.Add("Трапеция");

            LabelCurrentFigure.Text = FigureNames[0];
            PictureBoxDraw.Image    = Drawing;
        }
Exemple #2
0
        public static CRectangle CreateTemplate()
        {
            int[] TempMas;
            TempMas = new int[8];

            for (int i = 0; i < 8; i++)
            {
                TempMas[i] = 0;
            }

            CRectangle Temp = new CRectangle(TempMas);

            return(Temp);
        }
Exemple #3
0
        public override CFigure Create(int[] Parameters)
        {
            CRectangle Temp = new CRectangle(Parameters);

            return(Temp);
        }