Expression Blend可以让我们十分方便的创建基于WPF的UI,在本文中,我会介绍如何使用WPF画图形,并使用颜色等元素去修饰图形。
什么是笔刷?
MSDN 是这样解释的:Everything visible on your screen is visible because it was painted by a brush. For example, a brush is used to describe the background of a button, the foreground of text, and the fill of a shape. This topic introduces the concepts of painting with Windows Presentation Foundation (WPF) brushes and provides examples. Brushes enable you to paint user interface (UI) objects with anything from simple, solid colors to complex sets of patterns and images.
我们可以这样理解:当我们要某区域的颜色的时候,我们可以使用笔刷。
在 WPF中,颜色是由System.Windows.Media下的Color结构体来封装的。Color有三种颜色R,G,B组成。 除了这三个属性,Color还增加了一个alpha管道属性A。它用来表示透明度(Opacity)。值为0时,表示透明(taransparent)。 值为255时,表示不透明(opaque)。默认的颜色透明度为opaque。WP