internal static Brush GetPreviewBrush(BrushEffect effect, System.Windows.Media.Color color, ref SizeF previewRegion) { switch (effect) { case BrushEffect.Solid: return(new SolidBrush(color.ToGdiColor())); case BrushEffect.ToBottom: return(new LinearGradientBrush(new PointF(0, 0), new PointF(0, previewRegion.Height), Color.Transparent, color.ToGdiColor())); case BrushEffect.ToTop: return(new LinearGradientBrush(new PointF(0, previewRegion.Height), new PointF(0, 0), Color.Transparent, color.ToGdiColor())); case BrushEffect.ToRight: return(new LinearGradientBrush(new PointF(0, 0), new PointF(previewRegion.Width, 0), Color.Transparent, color.ToGdiColor())); case BrushEffect.ToLeft: return(new LinearGradientBrush(new PointF(previewRegion.Width, 0), new PointF(0, 0), Color.Transparent, color.ToGdiColor())); default: goto case BrushEffect.Solid; } }
public UICommandBrushEffect(BrushEffect effect) { this.effect = effect; }