RichText Gradient ColorFill ??
-
I have RichTextBox with some menu items I've added, like "bold", "italic" ...all the normal stuff. But I'd like to add some cool effect things too. Right now, I'd like to add a color gradient feature that would allow the user to choose two colors and the selected text does a gradient color change from color1 to color2. Kind of like you can do with Yahoo Messenger if you are familiar with Y!Messenger. I've seen an example of doing this with drawing through a built in API call, but is there a way I can do that with RichText (RTF) ? Or can I use a DrawString and convert it to RTF in some easy way? I started out trying to do it manually, but there are a lof of special cases depending on the distance of each color component (R, G and B), and the number of chars, etc... Any ideas?
There are only 10 types of people in this world....those that understand binary, and those that do not.
-
I have RichTextBox with some menu items I've added, like "bold", "italic" ...all the normal stuff. But I'd like to add some cool effect things too. Right now, I'd like to add a color gradient feature that would allow the user to choose two colors and the selected text does a gradient color change from color1 to color2. Kind of like you can do with Yahoo Messenger if you are familiar with Y!Messenger. I've seen an example of doing this with drawing through a built in API call, but is there a way I can do that with RichText (RTF) ? Or can I use a DrawString and convert it to RTF in some easy way? I started out trying to do it manually, but there are a lof of special cases depending on the distance of each color component (R, G and B), and the number of chars, etc... Any ideas?
There are only 10 types of people in this world....those that understand binary, and those that do not.
Check this, it's probably not exactly what you are looking for but pretty close. Give it a shot: Your first C# control[^] -Nick Parker