本文整理汇总了C#中System.Windows.Media.Color.Blend方法的典型用法代码示例。如果您正苦于以下问题:C# Color.Blend方法的具体用法?C# Color.Blend怎么用?C# Color.Blend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Color
的用法示例。
在下文中一共展示了Color.Blend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRender_BackgroundSolidTexture
private void OnRender_BackgroundSolidTexture(
DrawingContext dc,
ImageSource topStatic,
ImageSource topDynamic,
float textureOpacity,
Color background,
float gradient)
{
SetEnableWarp(true);
var opaque = background;
var faded = background.Blend(Colors.White, gradient);
//LinearGradientBrush lgBrush = new LinearGradientBrush(faded, opaque, 90);
var lgBrush = RenderToolFactory.GetTool<Brush>(new LinearGradientBrushTool(faded, opaque, 90));
dc.DrawRectangle(lgBrush, null, ScreenArea);
const int SQ_WIDTH = 66;
const int SQ_HEIGHT = 66;
const int SQ_X_OFF = SQ_WIDTH / 3;
const int SQ_Y_OFF = SQ_HEIGHT / 3;
var stBrush = RenderToolFactory.GetTool<Brush>
(new ImageBrushTool(topStatic,
TileMode.Tile,
new Rect(-SQ_X_OFF, SQ_Y_OFF, SQ_WIDTH, SQ_HEIGHT),
BrushMappingMode.Absolute,
textureOpacity));
dc.DrawRectangle(stBrush, null, ScreenArea);
var off = _isListening
? CompositionTargetEx.SecondsFromStart * 4
: (int) (SQ_WIDTH / 2);
// Dynamic Brush is Constantly Changing
const float WARP = (float) SQ_WIDTH / SQ_HEIGHT;
ImageBrush dyBrush = new ImageBrush(topDynamic)
{
TileMode = TileMode.Tile,
ViewportUnits = BrushMappingMode.Absolute,
Viewport = new Rect(off * WARP - SQ_X_OFF, off + SQ_Y_OFF, SQ_WIDTH, SQ_HEIGHT),
Opacity = textureOpacity
};
dc.DrawRectangle(dyBrush, null, ScreenArea);
OnRender_3DCorners(dc);
}