Exemple #1
0
        int widthForm, heightForm; // размеры основной формы

        #endregion Fields

        #region Constructors

        public FormSprite()
        {
            InitializeComponent();

            widthForm = this.Size.Width;
            heightForm = this.Size.Height;
            stepNet = 10;
            stepShift = 1;

            toolStripLabelXW.Text = "xW=" + this.Size.Width;
            toolStripLabelYW.Text = "yW=" + this.Size.Height;

            toolStripComboBoxWidthPen.SelectedIndex = 2;
            toolStripComboBoxStepNet.SelectedIndex = 0;
            toolStripComboBoxShift.SelectedIndex = 0;

            graph = new Graph(picture.Width, picture.Height);
            sprite = new Sprite();
            currPens = new DataSprite.Pens(ColorTranslator.ToHtml(Color.Black), 3);
            currFigure = new MyLine(currPens, 1, 1, 1, 1);

            flagLine = false;

            picture.Image = graph.GetBitmap;
        }
Exemple #2
0
        private void toolStripButtonNet_Click(object sender, EventArgs e)
        {
            if(toolStripButtonNet.Checked == true)
            {
                spriteNet = new Sprite();
                for(int x = stepNet; x < picture.Size.Width; x += stepNet)
                {
                    spriteNet.AddFigure(new MyLine(currPens, x, 0, 0, picture.Size.Height));
                }

                for (int y = stepNet; y < picture.Size.Height; y += stepNet)
                {
                    spriteNet.AddFigure(new MyLine(currPens, 0, y, picture.Size.Width, 0));
                }
            }

            graph.Clear();
            RefreshBitMap();
        }