• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

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


<Rectangle height =”1—“ width=”200”>
<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>


Image brush:-

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



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>
<Rectangle height =”100”, width = “100”>

<Image brush Imagesource = “Fl.Jpg”/>
</Image Brush>


Review Date
Reviewed Item
Gradient Origin in WPF
Author Rating

“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 *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.