Group Discounts available for 3+ students and Corporate Clients

Gradient Origin in WPF

Gradient Origin

To Fill the colors in elliptically we use following properties with Radial Gradient Brush

 

Eg to fill the colors elliptically in a rectangle

 

Create a new window

      ↓

Go to xaml source

      ↓

write the following code within grid

      ↓

<Grid>
<Rectangle height =”1—“ width=”200”>
<Rectangle.fill>
<Radial Gradient Bruch Gradient origin = “0.5, 0.5”
center = “0.5, 0.5” Radius X = “0.5” Radius Y = “0.5”>
<Gradient stop color=”yellow” offset = “0”/>
<Gradientstop color = “Red” offset = “0.23”/>
<Gradientstop color = “blue” offset =”0.75/>
<Gradientstop color+ “lineGreen” offset+”1”/>
</Radial Gradient Brush>
</Rectangle.fill>
</Rectangle>

 

Image brush:-

This is used to display the required image within the 2D graphic object like rectangle or ellipse etc.

 

Properties:-

Image Source  is the property which is used to display required image within the object

 

Eg With Image Brush:-

Create a new window

      ↓

Go To Xaml-1 Source

      ↓

Write the code in <Grid>
<Grid>
<Rectangle height =”100”, width = “100”>

<Rectangle.fill>
<ImageBrush>
<Image brush Imagesource = “Fl.Jpg”/>
</Image Brush>
</Rectangle-fill>
</Rectangle>

 

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Gradient Origin in WPF"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Support


    Please Enter Your Details and Query.
    Three + 6