Click here to Skip to main content
15,890,982 members
Home / Discussions / C#
   

C#

 
AnswerRe: Populate specifc Registry keys in Combobox Pin
Richard MacCutchan2-Dec-14 21:49
mveRichard MacCutchan2-Dec-14 21:49 
Questionhow do i get the application name from the default value in Registry/LocalMachine/Software/Classes/.docx/shell/Open/Command Pin
zen.liu872-Dec-14 16:11
zen.liu872-Dec-14 16:11 
AnswerRe: how do i get the application name from the default value in Registry/LocalMachine/Software/Classes/.docx/shell/Open/Command Pin
syed shanu2-Dec-14 17:50
professionalsyed shanu2-Dec-14 17:50 
QuestionPath stroke with multiple colors? Pin
SledgeHammer012-Dec-14 13:27
SledgeHammer012-Dec-14 13:27 
AnswerRe: Path stroke with multiple colors? Pin
BillWoodruff2-Dec-14 15:14
professionalBillWoodruff2-Dec-14 15:14 
GeneralRe: Path stroke with multiple colors? Pin
SledgeHammer012-Dec-14 17:26
SledgeHammer012-Dec-14 17:26 
GeneralRe: Path stroke with multiple colors? Pin
BillWoodruff2-Dec-14 18:33
professionalBillWoodruff2-Dec-14 18:33 
GeneralRe: Path stroke with multiple colors? Pin
SledgeHammer013-Dec-14 7:56
SledgeHammer013-Dec-14 7:56 
It is a stroked line.

Think of a stock chart for example. Typically, its a line graph where the above last close is stroked green and the below last close is stroked red. The last close line is typically a 1 pixel horizontal line. So, its very important asthetically for red pixels not to "bleed" over into the part of the chart thats above the last close line and for green pixels not to "bleed" over into the part of the chart thats below the last close line.

So... I'm trying to implement something similiar.

Paths don't natively support that kind of stroking, so the WPF "trick" is to use a vertical LinearGradientBrush and do a hard color change over at the correct Y position to match up with the horizontal line.

Unfortunately, the LinearGradientBrush works on a 0.0 to 1.0 coordinate system where as a line placed on a grid is going to work on a 0.0 to 26.0 coordinate system (control is 27 pixels high).

I kind of gave up on splitting the path as that has the same issue as the LinearGradientBrush and introduces the whole problem of having to write my own split algorithm.

So it seems like the real problem is I'm not "rounding / fudging" the LinearGradientBrush in the same way that a 1 pixel horizontal line is going to get rounded / fudged on to the grid.

Think about it, if I have a 27 pixel high control, there is certainly a center horizontal line at y=14 and you are left with 13 pixels on either side. HOWEVER, mathamatically speaking, that point is at 13.5.

Since my control is 27 pixels high, I think the y position needs to be rounded to .5's to match up the gradient break with the line break.

Haven't quite matched the WPF fudging though Frown | :(
GeneralRe: Path stroke with multiple colors? Pin
BillWoodruff4-Dec-14 4:51
professionalBillWoodruff4-Dec-14 4:51 
GeneralRe: Path stroke with multiple colors? Pin
SledgeHammer012-Dec-14 18:28
SledgeHammer012-Dec-14 18:28 
QuestionEmail Delivery Receipt Pin
Jassim Rahma1-Dec-14 21:12
Jassim Rahma1-Dec-14 21:12 
AnswerRe: Email Delivery Receipt Pin
BillWoodruff1-Dec-14 21:16
professionalBillWoodruff1-Dec-14 21:16 
GeneralRe: Email Delivery Receipt Pin
Jassim Rahma1-Dec-14 21:18
Jassim Rahma1-Dec-14 21:18 
GeneralRe: Email Delivery Receipt Pin
OriginalGriff1-Dec-14 21:34
mveOriginalGriff1-Dec-14 21:34 
Questionstrong encryption Pin
Jassim Rahma1-Dec-14 0:44
Jassim Rahma1-Dec-14 0:44 
SuggestionRe: strong encryption Pin
Richard MacCutchan1-Dec-14 1:19
mveRichard MacCutchan1-Dec-14 1:19 
Question[Solved] DataGridView, BindingList and combining object properties? Pin
ixilom30-Nov-14 5:54
ixilom30-Nov-14 5:54 
QuestionLink-grammar 5.1.3 /Windows, MSVC Pin
Member 1127414829-Nov-14 18:07
Member 1127414829-Nov-14 18:07 
AnswerRe: Link-grammar 5.1.3 /Windows, MSVC Pin
Garth J Lancaster29-Nov-14 19:06
professionalGarth J Lancaster29-Nov-14 19:06 
QuestionHow to Handle Redirects to Login When Trying to Read Results From HttpWebRequest? Pin
Member 1127231728-Nov-14 15:29
Member 1127231728-Nov-14 15:29 
Questionsetting file's security to 'no delete' in code ? Pin
BillWoodruff28-Nov-14 8:39
professionalBillWoodruff28-Nov-14 8:39 
QuestionRe: setting file's security to 'no delete' in code ? Pin
Eddy Vluggen28-Nov-14 8:54
professionalEddy Vluggen28-Nov-14 8:54 
AnswerRe: setting file's security to 'no delete' in code ? Pin
BillWoodruff28-Nov-14 14:11
professionalBillWoodruff28-Nov-14 14:11 
GeneralRe: setting file's security to 'no delete' in code ? Pin
Eddy Vluggen1-Dec-14 8:02
professionalEddy Vluggen1-Dec-14 8:02 
GeneralRe: setting file's security to 'no delete' in code ? Pin
Manfred Rudolf Bihy1-Dec-14 9:01
professionalManfred Rudolf Bihy1-Dec-14 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.