Applications = Code + Markup读书笔记(2)
1.由RGB三原色组成的颜色空间也叫sRGB颜色空间,sRGB空间将显示点阵图像的做法正式化
The RGB color space implied by byte values of red, green, and blue primaries is sometimes
known as the sRGB color space, where s stands for standard. The sRGB space formalizes
common practices in displaying bitmapped images from scanners and digital cameras on
computer monitors. When used to display colors on the video display, the values of the sRGB
primaries are generally directly proportional to the voltages of the electrical signals
sent from the video display board to the monitor.
2.引入了scRGB的概念,也被称为sRGB64
关于scRGB的Wikipedia: http://en.wikipedia.org/wiki/ScRGB
3.sRGB三原色存储类型为byte,scRGB三原色存储类型为float,由于scRGB可以大于1或小于0,所以scRGB颜
色空间更大
4.Brush体系结构
Object
└─DispatcherObject (abstract)
└─DependencyObject
└─Freezable (abstract)
└─Animatable (abstract)
└─Brush (abstract)
├─GradientBrush (abstract)
│ ├─LinearGradientBrush
│ └─RadialGradientBrush
│
├─SolidColorBrush
│
└─TileBrush (abstract)
├─DrawingBrush
├─ImageBrush
└─VisualBrush
5.关于Brush的动态事件机制,如上结构图,Brush继承自Freezable,而Freezable实现了changed事件,所以
只要Brush改变,都会通知事件的订阅者,该示例中就是通知Window来重绘窗体了,这一点需要和Winform进
行区分,Winform中除非人为处理,否则更改颜色不会触发窗体绘制
Obviously somebody is redrawing the client area every time the brush changes, but it's all
happening behind the scenes. This dynamic response is possible because Brush derives from
the Freezable class, which implements an event named Changed. This event is fired whenever
any changes are made to the Brush object, and this is how the background can be redrawn
whenever a change occurs in the brush.
This Changed event and similar mechanisms are used extensively behind the scenes in the
implementation of animation and other features in the Windows Presentation Foundation.
6.Brushes.PaleGoldenrod和new SolidColorBrush(Colors.PaleGoldenrod)虽然得到的是相同的brush,
但是在使用的时候要考虑到前者不允许被修改,因为前者是一个静态只读属性,还需要注意到Frozen的相关概念
The SolidColorBrush objects returned from the Brushes class are in a frozen state, which
means they can no longer be altered
7.LinearGradientBrush及RadialGradientBrush的一些属性和示例应用
活学活用,切勿读死书 @_@