Wie kann ich eine Flächenfüllung definieren, die eine Hintergrund-Farbe UND ein Schraffurmuster hat?
Ich kann nur entweder / oder:
Danke - Günther
Ich kann nur entweder / oder:
Code:
VisualBrush Hatch() { VisualBrush VB = new VisualBrush(); VB.Viewport = new Rect(0, 0, 10, 10); VB.ViewportUnits = BrushMappingMode.Absolute; VB.TileMode = TileMode.Tile; Line L = new Line(); L.X1 = 0; L.Y1 = 12; L.X2 = 12; L.Y2 = 0; L.Stroke = new SolidColorBrush(Colors.Black); L.StrokeThickness = 1; VB.Visual = L; return VB; } Path FlaechenPath() { Path P = new Path(); P.StrokeThickness = 1; P.Stroke = new SolidColorBrush(Colors.Black); P.Fill = Hatch(); // eine transparente, schraffierte Fläche // oder: P.Fill = new SolidColorBrush(Colors.Gray); // eine farbige Fläche return P; }
Comment