Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 6 > BOOK: C# 24-Hour Trainer 2nd Edition
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: C# 24-Hour Trainer 2nd Edition
This is the forum to discuss the Wrox book C# 24-Hour Trainer, 2nd Edition by Rod Stephens; ISBN: 978-1-119-06566-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: C# 24-Hour Trainer 2nd Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 23rd, 2016, 11:13 AM
Registered User
Points: 17, Level: 1
Points: 17, Level: 1 Points: 17, Level: 1 Points: 17, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2016
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Default Lesson 2 - Setting colors in WPF

I'm watching the video named "Setting colors in WPF".
The author says:
Quote:
"The StartPoint and the EndPoint give the coodinates on a 0 to 1 scale of the starting and the end of gradient.
0 means the gradient starts half way across the control horizontally and at the top vertically"
I draw the coordinate origin on a picture:

http://i67.tinypic.com/2e6akyf.jpg

He puts the StartPoint in the lower right corner so he changes it to (1,1) and the EndPoint to the upper left corner so he changes it to (0,0).
I don't understand these coordinates. I think they would be for the lower right corner (1,-1) and (-1,0) for the upper right corner.

Please, what am I doing wrong?

Thank you.

Last edited by euriloco; July 23rd, 2016 at 11:16 AM.
Reply With Quote
  #2 (permalink)  
Old July 23rd, 2016, 11:34 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
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)
  #3 (permalink)  
Old July 23rd, 2016, 12:02 PM
Registered User
Points: 17, Level: 1
Points: 17, Level: 1 Points: 17, Level: 1 Points: 17, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2016
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thank you very much.
I understood it.
Sorry, It was my fault.
These problems appears because English is not my first language.
I'm learning C# and improving my English with your book.
Reply With Quote
  #4 (permalink)  
Old July 23rd, 2016, 01:33 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
Thanks: 2
Thanked 96 Times in 95 Posts
Default

No problem. Let me know if you have other questions!
__________________
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
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Alternative Font Colors trtyler BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 2 October 12th, 2016 09:21 AM
no colors when printing Hylsan Beginning PHP 0 May 28th, 2007 05:06 AM
Colors scandalous Access 1 February 8th, 2007 12:01 PM
Row colors in listbox canmex Access 1 November 18th, 2006 08:01 PM
Problems with colors Sara Access VBA 4 January 21st, 2005 10:00 AM



All times are GMT -4. The time now is 05:34 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.