I have a rectangle and an angle. I need to provide the start and end points of a LinearGradientBrush in C# so that the gradient always fits perfectly within this rectangle and never under or over-extends the rectangle.
Could some of you mathletes out there help me out? I’m sure there’s a really simple solution to this.
Would the following work (I am unable to test it):