示例#1
0
        private void FillPoint(RGPoint p1, Color clr)
        {
            var np    = NPt(p1);
            var gr    = Graphics.FromImage(pictureBox.Image);
            var bgClr = RG.GetColorDirect(new RGPoint(p1), CProjection.UpC1C2);
            var blend = RG.Blend(clr, bgClr);

            gr.TryDraw(g => g.FillEllipse(new SolidBrush(clr), np.X - 2, np.Y - 2, 4, 4));
            gr.TryDraw(g => g.DrawRectangle(new Pen(blend), np.X - 10, np.Y - 10, 20, 20));
        }
示例#2
0
        private void FillPixel(Bitmap bmp, double x, double y)
        {
            var r     = x;
            var g     = y;
            var pt    = NPt(r, g);
            var cpt   = new RGPoint(r, g);
            var color = RG.GetColorDirect(cpt, CProjection.UpC1C2);

            SetPixel(bmp, pt.X, pt.Y, color);
            var orig = new RGPoint(r, g);

            if (InTriangle(orig))
            {
                var oneIteration = orig.DirectIterated();
                var pt1          = NPt(oneIteration.R, oneIteration.G);
                if (pt1.X >= 0 && pt1.Y >= 0 && pt1.X < bmp.Size.Width && pt1.Y < bmp.Size.Height)
                {
                    var clrR = Math.Max(0, color.R - 50);
                    var clrG = Math.Max(0, color.G - 50);
                    var clrB = Math.Max(0, color.B - 50);
                    SetPixel(bmp, pt1.X, pt1.Y, Color.Black);
                }
            }
        }