Announcement

Collapse
No announcement yet.

WPF schraffierte Fläche zeichnen - Hintergrundfarbe

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • WPF schraffierte Fläche zeichnen - Hintergrundfarbe

    Wie kann ich eine Flächenfüllung definieren, die eine Hintergrund-Farbe UND ein Schraffurmuster hat?
    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;
            }
    Danke - Günther
    Günther

  • #2
    http://mark-dot-net.blogspot.de/2007...sh-in-wpf.html

    Das ist was du suchst. Hier kannst du auch einen Hintergrund eingeben!

    Lg und gutes Neues
    Die Taschenlampe!

    Die perfekte Taschenlampe für Ihr Windows Phone!

    - Die APP steuert die echte Blitz-LED an und versorgt Sie mit 100% Leistung!
    - Zudem zeigt die Live-Kachel den aktuellen Akkustand des Telefons an!


    Hier gehts zu APP!

    Comment


    • #3
      Du hast Recht, das ist es.
      Danke - Günther
      Günther

      Comment

      Working...
      X