question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LinearGradientBrush is not working with StartPoint/EndPoint

See original GitHub issue

Hello! I’m trying to use . It’s working fine with horizontal gradient:

<LinearGradientBrush x:Key="BackgroundGradient">
            <GradientStop Offset="0" Color="#C2E4F6" />
            <GradientStop Offset="1" Color="#95CDEC" />
        </LinearGradientBrush>

But when I’m trying to make vertical gradient, background becomes solid:

<LinearGradientBrush x:Key="BackgroundGradient" StartPoint="0,0" EndPoint="0,1" >
            <GradientStop Offset="0" Color="#C2E4F6" />
            <GradientStop Offset="1" Color="#95CDEC" />
        </LinearGradientBrush>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
mstr2commented, Jun 11, 2019

Why not simply swap the default behavior? So “0,1” would be interpreted as a percentage (as it is in WPF, but adding the percentage sign would be optional), and “0px,1px” would be interpreted as pixels.

1reaction
kekekekscommented, Jun 6, 2019

100% equals to 1.0 + RelativeUnit.Relative while 1 equals to 1.0 + RelativeUnit.Absolute

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF C# Animate Linear Gradient Brush start point or end ...
And my code for animation is this but not work without errors. How I can animate this property correctly? Storyboard story1 = new...
Read more >
LinearGradientBrush.StartPoint Property (System.Windows ...
Gets or sets the starting two-dimensional coordinates of the linear gradient.
Read more >
CompositionLinearGradientBrush Class
Gets or sets a value that indicates whether the gradient brush's positioning coordinates (StartPoint, EndPoint) are absolute or relative to the output area....
Read more >
Gradient with setFill()? | Apple Developer Forums
Hello. I subclassed a UIView to do some drawing. Inside the view, I created a frame that takes only a part of the...
Read more >
Gradient fill angle - Ask the community
Hi, I'm seeing an angle on gradient fill, even though I should not. Is it something I'm doing wrong or a bug?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found