Highlights the gradient origin and the gradient circle : Color « Windows Presentation Foundation « C# / C Sharp






Highlights the gradient origin and the gradient circle

       

<Window x:Class="WpfApplication1.ShapesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ShapesWindow" Height="160" Width="400">

    <StackPanel>

    <Canvas ClipToBounds="True" Grid.Row="3" Grid.Column="2" Width="150" Height="150">
      <Rectangle Width="150" Height="150">
        <Rectangle.Fill>
          <RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.1,0.1" RadiusX="0.75" RadiusY="0.75">
            <GradientStop Color="White" Offset="0" />
            <GradientStop Color="#545454" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>ss
      <Path Fill="Red">
        <Path.Data>
          <EllipseGeometry Center="75,75" RadiusX="2" RadiusY="2" />
        </Path.Data>
      </Path>
      <Path Stroke="Red" StrokeThickness="2">
        <Path.Data>
          <EllipseGeometry Center="15,15" RadiusX="111.5" RadiusY="111.5" />
        </Path.Data>
      </Path>
    </Canvas>

    </StackPanel>
</Window>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Color AnimationColor Animation
2.using Color structuresusing Color structures
3.Use System Color to draw LineUse System Color to draw Line
4.This text uses a gradientThis text uses a gradient
5.Diagonal Linear GradientDiagonal Linear Gradient
6.A Partially Transparent ButtonA Partially Transparent Button
7.A Radial GradientA Radial Gradient
8.A Radial Gradient with an Offset CenterA Radial Gradient with an Offset Center
9.GradientStop with Transparent colorGradientStop with Transparent color
10.Simulating lighting effects with linear fillsSimulating lighting effects with linear fills
11.Color Converter With String FormatColor Converter With String Format
12.Colors and BrushesColors and Brushes
13.From a Hex string using ColorConverterFrom a Hex string using ColorConverter
14.From ScRGB values in the Color structureFrom ScRGB values in the Color structure
15.From sRGB values in the Color strutcureFrom sRGB values in the Color strutcure
16.From predefined color name in the Colors classFrom predefined color name in the Colors class
17.Fills the polylines with a light gray colorFills the polylines with a light gray color
18.Using SystemColors in CodeUsing SystemColors in Code
19.using system colors to create gradientsusing system colors to create gradients