public PdnLegacyBrush(PaintDotNet.BrushType type, PaintDotNet.UI.Media.HatchStyle hatchStyle, ColorBgra foreground, ColorBgra background) { this.Type = type; this.HatchStyle = hatchStyle; this.Foreground = foreground; this.Background = background; }
public static PaintDotNet.UI.Media.Brush CreateBrush(this AppSettings.ToolsSection toolSettings, ColorBgra32 foreColor, ColorBgra32 backColor) { PaintDotNet.BrushType type = toolSettings.Brush.Type.Value; PaintDotNet.UI.Media.HatchStyle hatchStyle = toolSettings.Brush.HatchStyle.Value; switch (type) { case PaintDotNet.BrushType.Solid: return(new SolidColorBrush((ColorRgba128Float)foreColor)); case PaintDotNet.BrushType.Hatch: return(new PaintDotNet.UI.Media.HatchBrush(hatchStyle, (ColorRgba128Float)foreColor, (ColorRgba128Float)backColor)); } throw new InvalidOperationException("BrushType is invalid"); }