private static double GetComputedOpacity(ClosedCaptionOpacity opacity) { switch (opacity) { case ClosedCaptionOpacity.SeventyFivePercent: return(.75); case ClosedCaptionOpacity.TwentyFivePercent: return(.25); case ClosedCaptionOpacity.ZeroPercent: return(0); default: return(1); } }
private static Color GetComputedColor(Color computedColor, ClosedCaptionOpacity opacity) { var a = (byte)(int)(GetComputedOpacity(opacity) * 255d); return(Color.FromArgb(a, computedColor.R, computedColor.G, computedColor.B)); }
private static SolidColorBrush GetComputedBrush(ClosedCaptionColor color, Color computedColor, ClosedCaptionOpacity opacity) { SolidColorBrush brush; if (color != ClosedCaptionColor.Default) { brush = new SolidColorBrush(computedColor); } else { brush = new SolidColorBrush(); } if (opacity != ClosedCaptionOpacity.Default) { brush.Opacity = GetComputedOpacity(opacity); } return(brush); }
private static double GetComputedOpacity(ClosedCaptionOpacity opacity) { switch (opacity) { case ClosedCaptionOpacity.SeventyFivePercent: return .75; case ClosedCaptionOpacity.TwentyFivePercent: return .25; case ClosedCaptionOpacity.ZeroPercent: return 0; default: return 1; } }
private static Color GetComputedColor(Color computedColor, ClosedCaptionOpacity opacity) { var a = (byte)(int)(GetComputedOpacity(opacity) * 255d); return Color.FromArgb(a, computedColor.R, computedColor.G, computedColor.B); }
private static SolidColorBrush GetComputedBrush(ClosedCaptionColor color, Color computedColor, ClosedCaptionOpacity opacity) { SolidColorBrush brush; if (color != ClosedCaptionColor.Default) { brush = new SolidColorBrush(computedColor); } else { brush = new SolidColorBrush(); } if (opacity != ClosedCaptionOpacity.Default) { brush.Opacity = GetComputedOpacity(opacity); } return brush; }