Fundamentally, each color is built from three color channels—red, green, blue. See how to define each color channel and create a custom color using Windows Presentation Foundation.
- [Instructor] One of the ways that you can assign a color…is through the channels that are available…in the color structure.…Here's an example that shows the color struct,…and you can see there's these properties,…A, B, G and R,…and those stand for Alpha, Blue, Green and Red.…You can assign a value to these properties…to change those channels and that will change…the color easy on the screen.…Another way that you can build a color…using the color struct is by using some of these methods.…The one I'll look at here is this one called FromArgb.…
There's also another one called FromRgb.…I'll start by showing you some code…to set these channel values, and then I'll end this video…by showing you how to use XAML to set the color channels.…I'll work over here in this MainWindow.xaml.…I've got this ellipse with a white fill,…and it's got a grey stroke.…So I'll add some code in this Fill button.…I'll press F7 to go take a look at the code, here it is.…I'll start by creating an instance of the color structure.…
Once I have my color, then I'll go to those channels,…
- Working with brushes
- Painting properties
- Painting in code
- Working with RGB channels
- Using hexadecimal values
- Setting opacity and transparency
- Editing color in the Visual Studio Color Editor
- Using gradient brushes
- Decorating with tiled brushes
- Adding brushes and colors to resources
- Working with opacity masks
Skill Level Intermediate
Windows Presentation Foundation: 2 Layoutwith Walt Ritscher2h 13m Intermediate
1. Brush and Color Overview
3. The Visual Studio Color Editor
4. The Gradient Brushes
5. The Tiled Brushes
6. Brushes and Colors in Resources
7. Opacity Mask
Examples of opacity patterns6m 47s
Next steps1m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.