private static Brush CreateHatchBrush(Color clr) { LinearGradientBrush brush = new LinearGradientBrush(); brush.set_MappingMode(0); brush.set_SpreadMethod(2); brush.set_StartPoint(new Point(0.0, 0.0)); brush.set_EndPoint(new Point(3.0, 3.0)); GradientStop stop = new GradientStop(); stop.set_Color(clr); brush.get_GradientStops().Add(stop); stop = new GradientStop(); stop.set_Color(clr); stop.set_Offset(0.5); brush.get_GradientStops().Add(stop); stop = new GradientStop(); stop.set_Color(Colors.get_Transparent()); stop.set_Offset(0.5); brush.get_GradientStops().Add(stop); stop = new GradientStop(); stop.set_Color(Colors.get_Transparent()); stop.set_Offset(1.0); brush.get_GradientStops().Add(stop); return(brush); }
private static Brush CreateHatchBrush(Color clrLo, Color clrHi) { LinearGradientBrush brush = new LinearGradientBrush(); brush.set_MappingMode(1); brush.set_SpreadMethod(0); brush.set_StartPoint(new Point(0.0, 0.0)); brush.set_EndPoint(new Point(0.0, 1.0)); GradientStop stop = new GradientStop(); stop.set_Color(clrLo); brush.get_GradientStops().Add(stop); stop = new GradientStop(); stop.set_Color(clrHi); stop.set_Offset(1.0); brush.get_GradientStops().Add(stop); return(brush); }