コード例 #1
0
        private void RedrawWithArea()
        {
            if (_bgWithArea != null)
            {
                _bgWithArea.Dispose();
            }
            _bgWithArea = _bg.Clone() as Bitmap;

            var initialLstPositive = (_arc ? RGPoint.GetArcPositive(_h1, _h2, _ypxsz, CProjection.UpC1C2) : RGPoint.GetTrianglePositive(_h1, _h2, _xpxsz, _ypxsz, CProjection.UpC1C2)).ToList();
            var initialLstNegative = (_arc ? RGPoint.GetArcNegative(_h1, _h2, _ypxsz, CProjection.UpC1C2) : RGPoint.GetTriangleNegative(_h1, _h2, _xpxsz, _ypxsz, CProjection.UpC1C2)).ToList();

            _areaInitialSetCPositive = initialLstPositive.Select(e => e.Key).ToList();
            _areaInitialSetCNegative = initialLstNegative.Select(e => e.Key).ToList();

            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Yellow, _areaInitialSetCPositive, _bgWithArea, CProjection.UpC1C2);
            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Red, _areaInitialSetCNegative, _bgWithArea, CProjection.UpC1C2);

            var iteratedPositive = RGPoint.DirectIteratedMany(_areaInitialSetCPositive, trackArea.Maximum, CProjection.C1C2).ToList();
            var iteratedNegative = RGPoint.DirectIteratedMany(_areaInitialSetCNegative, trackArea.Maximum, CProjection.C1C2).ToList();

            _iteratedAreasCPositive = iteratedPositive.Select(e => e.Key.ToList()).ToList();
            _iteratedAreasCPositive.Insert(0, _areaInitialSetCPositive);
            _iteratedAreasCNegative = iteratedNegative.Select(e => e.Key.ToList()).ToList();
            _iteratedAreasCNegative.Insert(0, _areaInitialSetCNegative);

            ChangePictureBoxPicture(_bgWithArea);
            pictureBox.Update();
        }
コード例 #2
0
        private void RedrawArea()
        {
            ChangePictureBoxPicture(_bg);
            var img         = pictureBox.Image.Clone() as Bitmap;
            var ptsPositive = _iteratedAreasCPositive[_areaStep];
            var ptsNegative = _iteratedAreasCNegative[_areaStep];

            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Yellow, ptsPositive, img, CProjection.UpC1C2);
            RG.FillArea(X, Y, _xpxsz, _ypxsz, _sz, Config.Red, ptsNegative, img, CProjection.UpC1C2);
            ChangePictureBoxPicture(img);
        }