Linear Gradient from bottom to top
Asked Answered
P

2

8

I need an Ellipse with a linear gradient from bottom(pink) to top(red).

<Ellipse Width="200" Height="200">    
    <Ellipse.Fill>

        <LinearGradientBrush StartPoint="0,1" EndPoint="1,0" > 

            <GradientStop Color="Pink" Offset="0" />

            <GradientStop Color="Red" Offset="1" />

        </LinearGradientBrush>

    </Ellipse.Fill>    
</Ellipse>

The above code shows a gradient from left bottom to top right.

I need the gradient to move from left middle to top middle.

I tried changing the starting and end point with no success. Is there another property that can be used?

It has to be a linear gradient on a ellipse. I cannot use a radial gradient here.

Penetrate answered 21/4, 2016 at 11:31 Comment(0)
I
18

gradient from Bottom to Top (vertical)

<LinearGradientBrush StartPoint="0,1" EndPoint="0,0">

gradient from left middle to top middle

<LinearGradientBrush StartPoint="0,0.5" EndPoint="0.5,0">
Interdisciplinary answered 21/4, 2016 at 11:48 Comment(0)
H
10

Visual representation of how it works

enter image description here

enter image description here

enter image description here

Humane answered 9/10, 2020 at 12:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.