Benutzer:MovGP0/WPF/Transforms

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      


Elemets with Transformations
  • Geometry
  • Brush
    • RelativeTransform
    • Transform
  • FrameworkElement
    • RenderTransform-Property
      (transformation without adjusting)
    • LayoutTransform-Property
      (adjusting the size of the object to fit inside the parent)
Transformations
  • ScaleTransform
  • TranslateTransform
  • RotateTransform
  • SkewTransform
  • TransformGroup
  • MatrixTransform

Cuts off everything outside of the clipping area.

<Button>
  <Button.Clip>
    <EllipseGeometry Center="28,12" RadiusX="30" RadiusY="10" />
  </Button.Clip>
</Button>

Defines a gradient for transparency.

<Button>
  <Button.OpacityMask>
    <RadialGradientBrush>
      <GradientStop Color="Transparent" Offset="0" />
      <GradientStop Color="White" Offset="0.4" />
      <GradientStop Color="White" Offset="0.8" />
      <GradientStop Color="Transparent" Offset="1" />
    </RadialGradientBrush>
  </Button.OpacityMask>
</Button>
  • renders in Software before .NET 3.5
  • implemented as GPU shaders in .NET 3.5+
    • custom shaders are possible
Effects
  • DropShadowBitmapEffect
  • BlurBitmapEffect
  • EmbossBitmapEffect
  • BevelBitmapEffect
  • OuterGlowBitmapEffect
  • BitmapEffectGroup
  • can animate any property of an FrameworkElement
<Rectangle Fill="Green" HorizontalAlignment="Left" Height="24">
  <Rectangle.Triggers>
    <EventTrigger RoutedEvent="Rectangle.Loaded">
      <BeginStoryboard>
        <Storyboard>
          <DoubleAnimation From="10.0" To="100,0" Duration="0:0:10" 
                           Storyboard.TargetProperty="(Rectangle.Width)" />
        </Storyboard>
      </BeginStoryboard>
    </EventTrigger>
  <Rectangle.Triggers>
</Rectangle>