DrawingBrush.RelativeTransform RotateTransform : DrawingBrush « Windows Presentation Foundation « C# / CSharp Tutorial






<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
        <Rectangle
          Width="100" Height="100"
          Stroke="Black" StrokeThickness="1">
          <Rectangle.Fill>
            <DrawingBrush Viewport="0,0,0.5,0.5" TileMode="Tile">
              <DrawingBrush.RelativeTransform>
                <RotateTransform CenterX="0.5" CenterY="0.5" Angle="45" />
              </DrawingBrush.RelativeTransform>
              <DrawingBrush.Drawing>
                <DrawingGroup>
                  <DrawingGroup.Children>
                    <GeometryDrawing Geometry="M0,0.1 L0.1,0 1,0.9, 0.9,1z"
                      Brush="Gray" />
                    <GeometryDrawing Geometry="M0.9,0 L1,0.1 0.1,1 0,0.9z"
                      Brush="Red" />
  
                  </DrawingGroup.Children>
                </DrawingGroup>
              </DrawingBrush.Drawing>
            </DrawingBrush>
          </Rectangle.Fill>
        </Rectangle>
</Window>
WPF Drawing Brush Relative Transform Rotate Transform








24.98.DrawingBrush
24.98.1.Using a DrawingBrush as an Opacity MaskUsing a DrawingBrush as an Opacity Mask
24.98.2.DrawingBrush and DrawingGroupDrawingBrush and DrawingGroup
24.98.3.DrawingBrush.Transform SkewTransformDrawingBrush.Transform SkewTransform
24.98.4.DrawingBrush.RelativeTransform RotateTransformDrawingBrush.RelativeTransform RotateTransform
24.98.5.Opacity Mask from DrawingOpacity Mask from Drawing
24.98.6.A DrawingBrush paints an area with a drawingA DrawingBrush paints an area with a drawing
24.98.7.Patterns defined by the DrawingBrush expand to fill the area of the rectanglePatterns defined by the DrawingBrush expand to fill the area of the rectangle
24.98.8.Non-tiled Drawingrush examplesNon-tiled Drawingrush examples
24.98.9.Tiled DrawingBrush examplesTiled DrawingBrush examples
24.98.10.An ImageDrawing enables a DrawingBrush to contain imagesAn ImageDrawing enables a DrawingBrush to contain images