protected override void OnPaint(PaintEventArgs e) { if (this.int_0 <= 0) { return; } int num1 = this.int_0 * this.int_0; double num2 = 1.0 / (double)this.int_0; int num3 = this.Width / 2; int num4 = this.Height / 2; int num5 = this.int_0 * 2 + 1; using (Bitmap bitmap = new Bitmap(num5, num5)) { for (int index1 = -this.int_0; index1 <= this.int_0; ++index1) { int num6 = index1 * index1; for (int index2 = -this.int_0; index2 <= this.int_0; ++index2) { int num7 = num6 + index2 * index2; if (num7 <= num1) { double d = System.Math.Sqrt((double)num7) * num2; System.Drawing.Color color = ColorWheel.smethod_0((double)index1, (double)index2, d); bitmap.SetPixel(index1 + this.int_0, index2 + this.int_0, color); } } } e.Graphics.DrawImageUnscaled((Image)bitmap, num3 + -this.int_0, num4 - this.int_0); } if (!this.nullable_0.HasValue) { return; } Vector2D vector2D = (double)this.int_0 * this.GetNormalizedColorLocation(this.nullable_0.Value); Point2D point2D = new Point2D((double)(int)System.Math.Round(vector2D.X), (double)(int)System.Math.Round(vector2D.Y)); int x = (int)System.Math.Round((double)num3 + point2D.X); int y = (int)System.Math.Round((double)num4 + point2D.Y); e.Graphics.FillPolygon(Brushes.Black, new Point[3] { new Point(x - 3, y - 2 - 10), new Point(x, y - 2), new Point(x + 3, y - 2 - 10) }); e.Graphics.FillPolygon(Brushes.Black, new Point[3] { new Point(x - 3, y + 2 + 10), new Point(x, y + 2), new Point(x + 3, y + 2 + 10) }); e.Graphics.FillPolygon(Brushes.Black, new Point[3] { new Point(x - 2 - 10, y - 3), new Point(x - 2, y), new Point(x - 2 - 10, y + 3) }); e.Graphics.FillPolygon(Brushes.Black, new Point[3] { new Point(x + 2 + 10, y - 3), new Point(x + 2, y), new Point(x + 2 + 10, y + 3) }); }
public System.Drawing.Color GetColor(Vector2D normalizedColorLocation) { Vector2D vector2D = normalizedColorLocation; return(ColorWheel.smethod_0(vector2D.X, vector2D.Y, vector2D.GetLength())); }