从角色创建图像 [英] create image from character

查看:70
本文介绍了从角色创建图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Metro应用程序使用标准样式.这些样式大多数都包含Image,我想使用Segoe UI Symbol作为这些图像.

I'm using standard styles for my Metro app. Most of these styles contains an Image and I wanna use Segoe UI Symbols as these images.

我该如何实现?

推荐答案

您可以在使用Segoe UI符号作为字体的任何文本内容中插入字符".如果我想在TextBlock中添加收藏的星星",它将看起来像这样...

You can insert the "character" in any text content that is using the Segoe UI Symbol as the font. If I wanted a Favorite's Star in a TextBlock, it would look like this...

<TextBox x:Name="textBox" HorizontalAlignment="Left" Margin="372,375,0,0" TextWrapping="Wrap" Text="&#xE113;" VerticalAlignment="Top" FontFamily="Segoe UI Symbol"/>

如果我想制作一个带有相同字符"的按钮,我会这样做...

If I wanted to make a button that had the same "character" in it, I would do this...

<Button x:Name="button" Content="&#xE113;" HorizontalAlignment="Left" Margin="372,181,0,0" VerticalAlignment="Top" Click="button_Click" FontFamily="Segoe UI Symbol" FontSize="24"  Height="79" Width="128"/>

如果我希望按钮采用圆形的AppBar按钮样式,则可以这样添加样式资源...

If I wanted the button to take on the circle AppBar button style, I would add the Style resource like this...

<Button x:Name="button" Content="&#xE113;" HorizontalAlignment="Left" Margin="372,181,0,0" VerticalAlignment="Top" Click="button_Click" FontFamily="Segoe UI Symbol" FontSize="24" Style="{StaticResource AppBarButtonStyle}" Height="79" Width="128"/>

如果使用的是HTML,则使用相同的方法.只要确保您的样式是正确的...

Same type of approach if you are using HTML. Just make sure you styles are correct...

<span class="pagetitle">&#xE113;</span>

这篇关于从角色创建图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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