/// <inheritdoc /> public override IDisposable BeginShape(Color color) { var localPath = new GraphicsPath(FillMode.Alternate); this.path = localPath; return(new ActionDisposable(() => { Interlocked.CompareExchange(ref this.path, null, localPath); var state = graphics.Save(); try { graphics.SmoothingMode = SmoothingMode.AntiAlias; graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; using (var brush = new SolidBrush(color.ToGdi())) { graphics.FillPath(brush, localPath); } } finally { graphics.Restore(state); localPath.Dispose(); } })); }
/// <inheritdoc /> public override void SetBackground(Color color, Rectangle iconBounds) { using (var brush = new SolidBrush(color.ToGdi())) { graphics.FillRectangle(brush, iconBounds.X, iconBounds.Y, iconBounds.Width, iconBounds.Height); } }
/// <inheritdoc /> public override void SetBackground(Color color) { graphics.Clear(color.ToGdi()); }