public TextureBrushesSection2()
{
image = TestIcons.Textures;
var drawable = new BufferedDrawable();
var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
layout.AddSeparateRow(null, drawable.Checkbox(), null);
layout.Add(drawable);
this.Content = layout;
var w = image.Size.Width / 3; // same as height
var img = image.Clone(new Rectangle(w, w, w, w));
var textureBrush = new TextureBrush(img);
var solidBrush = new SolidBrush(Colors.Blue);
var linearGradientBrush = new LinearGradientBrush(Colors.White, Colors.Black, PointF.Empty, new PointF(0, 100));
var font = SystemFonts.Default();
drawable.BackgroundColor = Colors.Green;
drawable.MouseMove += HandleMouseMove;
drawable.MouseDown += HandleMouseMove;
drawable.Paint += (s, e) =>
{
var graphics = e.Graphics;
graphics.DrawText(font, Colors.White, 3, 3, "Move the mouse in this area to move the shapes.");
// texture brushes
var temp = location;
DrawShapes(textureBrush, temp, img.Size, graphics);
// solid brushes
temp = temp + new PointF(200, 0);
DrawShapes(solidBrush, temp, img.Size, graphics);
// linear gradient brushes
temp = temp + new PointF(200, 0);
DrawShapes(linearGradientBrush, temp, img.Size, graphics);
};
}