Пример #1
0
 public void RadialGradientSmall()
 {
     InitBlank ();
     var g = new RadialGradient (5, 5, 5, 30, 30, 15);
     g.AddColorStop (0, Colors.Red);
     g.AddColorStop (0.5, Colors.Green);
     g.AddColorStop (1, Colors.Blue);
     context.Rectangle (5, 5, 40, 40);
     context.Pattern = g;
     context.Fill ();
     CheckImage ("RadialGradientSmall.png");
 }
Пример #2
0
 public void SaveRestoreRadialGradient()
 {
     // Pattern is saved
     InitBlank ();
     var g = new RadialGradient (20, 20, 5, 30, 30, 30);
     g.AddColorStop (0, Colors.Red);
     g.AddColorStop (0.5, Colors.Green);
     g.AddColorStop (1, Colors.Blue);
     context.Save ();
     context.Pattern = g;
     context.Restore ();
     context.Rectangle (5, 5, 40, 40);
     context.Fill ();
     CheckImage ("SaveRestoreRadialGradient.png");
 }
Пример #3
0
 RadialGradient GetCornerGradient(double x, double y, double radius, double thickness)
 {
     var gradient = new RadialGradient (x, y, radius - thickness, x, y, radius + thickness);
     gradient.AddColorStop (0, BackgroundColor);
     gradient.AddColorStop (1, GetColor (BackgroundColor, 0.75));
     return gradient;
 }