How create glossy button in C#? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this questionI want create glossy buttons with GDI+ or Silv开发者_如何转开发erlight with C#, any ideas or trickery how to create a glossy button? Somethings like images below:
I am interesting more in GDI+ solutions.
- Creating Gel Buttons with Windows Forms : Part 1 (archive)
- Creating Gel Buttons with Windows Forms : Part 2 (archive)
- Creating Gel Buttons with Windows Forms : Part 3 (archive)
Chris Jackson, Microsoft Appcompat Guy, wrote that for .NET (i.e. C# and GDI+).
Windows Forms Gel Buttons : First Revision
Windows Forms Gel Buttons : Second Revision
Windows Forms Gel Buttons - Third Revision
All the code is there, along with careful consideration of
- scaling with high dpi
- performance and bitmap caching
Example here:
This article demonstrates how to use the
WindowsVistaRenderer
and how it was created...I've found different layers on the button drawing...
A glossy effect is drawn on the north of the button. The green color represents an almost transparent color...
Now, the order in which we draw these layers is critical. That order is:
- Outer border
- Button background color (if button is checked)
- Glossy effect
- Border
- Button fill glossy emphasis
- Inner border
- Glow
- Text and image of the button...
In Silverlight it's very simple to create this buttons in Xaml with brushes.
See this link for some good samples: Glossy Brushes using Radial Gradient Brush in WPF
You can also use Microsoft Expression Design to create these buttons or simply import from Adobe Illustrator or Adobe Photoshop and then export them to Xaml.
You can also check this CodeProject article, a nice tutorial shows how to make some glossy circular buttons in expression blend: Glass Orb Button in Silverlight
Also there are lots of projects related to glass buttons and glossy effects made using GDI+ or expression blend in codeproject.
You can also use Expression Blend.
精彩评论