View Single Post
  #2 (permalink)  
Old July 23rd, 2016, 11:34 AM
Rod Stephens's Avatar
Rod Stephens Rod Stephens is offline
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

The key is that the coordinates go from (0, 0) in the upper left corner to (1, 1) in the lower right corner.

You have the quote from the video just a little bit wrong, and I think that's causing the confusion. The correct quote is:

Quote:
The StartPoint and the EndPoint give the coodinates on a 0 to 1 scale of the start and the end of the gradient. The 0.5 and the 0 for the start point means this gradient starts halfway across the control horizontally and at the top vertically.
So the coordinates go from (0, 0) in the upper left corner to (1, 1) in the lower right corner.

When you first create the control, the gradient starts at (0.5, 0) and ends at (0.5, 1) so the gradient moves from the top middle to the bottom middle.

In the video I change the gradient's coordinates so it starts at (1, 1) and ends at (0, 0).

I hope that helps. Let me know if it's still unclear.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
The Following User Says Thank You to Rod Stephens For This Useful Post:
euriloco (July 23rd, 2016)