配置字幕布局(字体,颜色等) [英] Configure captions layout (font, colors etc.)

查看:57
本文介绍了配置字幕布局(字体,颜色等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!


我正在尝试为视频添加字幕,并想知道如何为opache框,字体,文字颜色等设置背景颜色。


无论我使用哪一个模板,我都会得到一个灰色/银色文本框,我希望它是黑色的 - 带有白色文字字体。此外,字幕会在视频下方显示,我希望它位于图片的顶部。 是否有某处
我指定了这些设置?


任意帮助将不胜感激! :)

解决方案

在EE3播放器中,标题背景区域的颜色,位置 ,文本的大小和颜色等等由模板中的XAML定义 - 您可以使用"Blend"中的"模板的编辑副本"来自定义此区域的外观。
或"在Visual Studio中编辑模板副本"命令:


一旦你有"Page.XAML"打开 - 寻找这一点XAML:


          < Grid x:Name =" closedCaptionArea" Grid.Row = QUOT; 0"的Horizo​​ntalAlignment = QUOT;拉伸" VerticalAlignment = QUOT;底座"可见性=" {TemplateBinding CaptionsVisibility}">          < Rectangle x:Name =" ; closedCaptionBackground"填充= QUOT;#7F5e5e"的Horizo​​ntalAlignment = QUOT;拉伸"高度="0"/>

           < TextBlock x:Name =" textBlockCaption" Grid.Row = QUOT; 0" Grid.RowSpan = QUOT 1 QUOT;余量= QUOT; 2,2,2,2"的Horizo​​ntalAlignment = QUOT;拉伸" VerticalAlignment = QUOT;底座"高度= QUOT;自动"字号= QUOT; 24英寸;前景= QUOT;#7FFFFFFF"
TextAlignment =" Center" TextWrapping = QUOT;包覆与QUOT; Text =" {TemplateBinding CaptionText}" />&
          < / Grid>


如果你开始使用"Silverlight 3默认值"模板 - 您需要使用"编辑模板 - 编辑副本"获取"通用"命令的命令XAML复制到Page.XAML以允许自定义。 


通过更改填充=="#7F5e5e" 标记您可以更改标题背景颜色   - 同样地,您可以更改Foreground ="#7FFFFFFF" 设置以更改文本颜色和FontSize ="24"。设置以使文字变大或变小。 
等。


为了让字幕看起来更好看 - 这是我喜欢的方法 - 它创建了三个文本框 - 创建了一个"高亮/阴影"效果


          < Grid x:Name =" closedCaptionArea" Grid.Row = QUOT; 0"的Horizo​​ntalAlignment = QUOT;拉伸" VerticalAlignment = QUOT;底座"可见性=" {TemplateBinding CaptionsVisibility}">          < Rectangle x:Name =" ; closedCaptionBackground"填充= QUOT;#00000000"的Horizo​​ntalAlignment = QUOT;拉伸"高度="0"/>




            < TextBlock x:Name =" textBlockCaptionHighlight" Grid.Row = QUOT; 0" Grid.RowSpan = QUOT 1 QUOT;余量= QUOT; 1,1,3,3-"的Horizo​​ntalAlignment = QUOT;拉伸" VerticalAlignment = QUOT;底座"高度= QUOT;自动"字号= QUOT; 24英寸;前景= QUOT;#7FFFFFFF"
TextAlignment =" Center" TextWrapping = QUOT;包覆与QUOT; Text =" {TemplateBinding CaptionText}" />


           < TextBlock x:Name =" textBlockCaptionShadow" Grid.Row = QUOT; 0" Grid.RowSpan = QUOT 1 QUOT;余量= QUOT; 3,3,1,1"的Horizo​​ntalAlignment = QUOT;拉伸" VerticalAlignment = QUOT;底座"高度= QUOT;自动"字号= QUOT; 24英寸;前景= QUOT;#7F000000"
TextAlignment =" Center" TextWrapping = QUOT;包覆与QUOT; Text =" {TemplateBinding CaptionText}" />


&p>

           < TextBlock x:Name = QUOT; textBlockCaption" Grid.Row = QUOT; 0" Grid.RowSpan = QUOT 1 QUOT;余量= QUOT; 2,2,2,2"的Horizo​​ntalAlignment = QUOT;拉伸" VerticalAlignment = QUOT;底座"高度= QUOT;自动"字号= QUOT; 24英寸;前景= QUOT;#7FC0C0C0"
TextAlignment =" Center" TextWrapping = QUOT;包覆与QUOT; Text =" {TemplateBinding CaptionText}" />&
          < / Grid>


 


 


Hello!

I'm trying to add captions to a video, and would like to know how to set background color for the opache box, fonts, text color etc.

No matter which one of the templates I use, I get a grey/silver textbox, and I would like it to be black - with white text font. Also, the captions turn up way below the video, and I would like it on top of the picture. Is there somewhere I specify these settings?

Any help would be appreciated! :)

解决方案

In the EE3 player the colors of the caption background area, it's location , the size and color of the text, etc are defined by XAML in the template -- you may customize the appearance of this area by using the "edit copy of template in Blend" or "Edit copy of template in Visual Studio" commands:

Once you have "Page.XAML" open -- look for this bit of XAML:

          <Grid x:Name="closedCaptionArea" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Visibility="{TemplateBinding CaptionsVisibility}">
           <Rectangle x:Name="closedCaptionBackground" Fill="#7F5e5e" HorizontalAlignment="Stretch" Height="0"/>
           <TextBlock x:Name="textBlockCaption" Grid.Row="0" Grid.RowSpan="1" Margin="2,2,2,2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="Auto" FontSize="24" Foreground="#7FFFFFFF" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding CaptionText}" />
          </Grid>

If you start with the "Silverlight 3 Default" template -- you need to use the "Edit Template - Edit Copy" command to get the "generic" XAML copied into Page.XAML to allow customization. 

By changing the Fill=="#7F5e5e"  tag you may change the caption background color   -- similarly you may change the Foreground="#7FFFFFFF"  setting to change the text color and the FontSize="24" setting to make the text larger or smaller.  etc.

To make the captions actually look better -- here is an approach that I like -- it creates three textboxes -- creating a "highlight/shadow" effect

          <Grid x:Name="closedCaptionArea" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Visibility="{TemplateBinding CaptionsVisibility}">
           <Rectangle x:Name="closedCaptionBackground" Fill="#00000000" HorizontalAlignment="Stretch" Height="0"/>


           <TextBlock x:Name="textBlockCaptionHighlight" Grid.Row="0" Grid.RowSpan="1" Margin="1,1,3,3" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="Auto" FontSize="24" Foreground="#7FFFFFFF" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding CaptionText}" />

           <TextBlock x:Name="textBlockCaptionShadow" Grid.Row="0" Grid.RowSpan="1" Margin="3,3,1,1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="Auto" FontSize="24" Foreground="#7F000000" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding CaptionText}" />


           <TextBlock x:Name="textBlockCaption" Grid.Row="0" Grid.RowSpan="1" Margin="2,2,2,2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="Auto" FontSize="24" Foreground="#7FC0C0C0" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding CaptionText}" />
          </Grid>

 

 


这篇关于配置字幕布局(字体,颜色等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆