Applies a RotateTransform to the DrawingBrush's RelativeTransform property : vb « Windows Presentation Foundation « C# / C Sharp






Applies a RotateTransform to the DrawingBrush's RelativeTransform property

Applies a RotateTransform to the DrawingBrush's RelativeTransform property
     
<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">
    <Window.Resources>
    <DrawingGroup x:Key="myDrawing" >
      <GeometryDrawing>
        <GeometryDrawing.Geometry>
          <GeometryGroup>
            <LineGeometry StartPoint="0,0" EndPoint="1,1" />
            <LineGeometry StartPoint="0,1" EndPoint="1,0" />
          </GeometryGroup>
        </GeometryDrawing.Geometry>
        <GeometryDrawing.Pen>
          <Pen Thickness="0.2" Brush="#3366FF" />
        </GeometryDrawing.Pen>
      </GeometryDrawing>
      <GeometryDrawing Brush="Red"
       Geometry="M 0.4,0.4 L 0.5,0.2 0.6,0.4 0.5,0.5" />
    </DrawingGroup>
    </Window.Resources>
    <Rectangle Width="175" Height="90" Stroke="Black">
      <Rectangle.Fill>
        <DrawingBrush Drawing="{StaticResource myDrawing}">
          <DrawingBrush.RelativeTransform>
            <RotateTransform CenterX="0.5" CenterY="0.5" Angle="45" />
          </DrawingBrush.RelativeTransform>
        </DrawingBrush>
      </Rectangle.Fill>
    </Rectangle>

</Window>

   
    
    
    
    
  








Related examples in the same category

1.RotateRotate
2.TranslateTranslate
3.Gradient brushes within a DrawingBrushGradient brushes within a DrawingBrush
4.Style resource with predefined static resourceStyle resource with predefined static resource
5.The Opacity Mask Use the opacity mask brush as a fill to show what it looks likeThe Opacity Mask Use the opacity mask brush as a fill to show what it looks like
6.Desktop to AppWorkspaceDesktop to AppWorkspace
7.StackPanel.Orientation=VerticalStackPanel.Orientation=Vertical
8.Line Joins MiterLine Joins Miter
9.Reference SystemColorsReference SystemColors
10.Document StylesDocument Styles
11.Multiple SoundsMultiple Sounds
12.Animated Text TransformAnimated Text Transform
13.Discrete Point JumpsDiscrete Point Jumps
14.Resource LookupResource Lookup
15.Horizontal Linear Gradient and GradientStopHorizontal Linear Gradient and GradientStop
16.Reflected GradientReflected Gradient
17.Multicolored GradientMulticolored Gradient
18.Shape UnionShape Union
19.Shape XorShape Xor
20.Shape ExcludeShape Exclude
21.A Delay of 0 and Interval of 1 make this a fast slider.A Delay of 0 and Interval of 1 make this a fast slider.
22.Normal Slider (Max=100, Val=10)Normal Slider (Max=100, Val=10)