矢量字体图标FontAwesome.WPF
2021-05-28 01:02
标签:ons fonts source nts icons ros present text base FontAwesome.WPF是对FontAwesome的封装。可能会比直接使用FontAwesome要方便一点。 项目网站:https://github.com/charri/Font-Awesome-WPF 安装: 使用: 也可以使用以TextBlock为基础的: 官方的解释: The Image based ImageAwesome control is useful when you need to fill an entire space. Whereas the TextBlock base FontAwesome is useful when you need a certain FontSize. 大概的意思是:ImageAwesome比较适合根据容器填充的地方,FontAwesome适合自己去控制字体大小的地方。 也可以在一些ContentControl控件上使用,例如下面的Button: 后台的cs代码中使用: 一些一直在旋转的图标: 旋转指定角度或翻转图标: 矢量字体图标FontAwesome.WPF 标签:ons fonts source nts icons ros present text base 原文地址:https://www.cnblogs.com/wzwyc/p/14765449.htmlInstall-Package FontAwesome.WPF
Window x:Class="Example.FontAwesome.WPF.Single"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fa="http://schemas.fontawesome.io/icons/"
Title="Single" Height="300" Width="300">
Grid Margin="20">
fa:ImageAwesome Icon="Flag" VerticalAlignment="Center" HorizontalAlignment="Center" />
Grid>
Window>
Button fa:Awesome.Content="Flag"
TextElement.FontFamily="pack://application:,,,/FontAwesome.WPF;component/#FontAwesome"/>
Icon = ImageAwesome.CreateImageSource(FontAwesomeIcon.Flag, Brushes.Black);
fa:ImageAwesome Icon="Spinner" Spin="True" SpinDuration="10" />
fa:ImageAwesome Icon="Spinner" FlipOrientation="Horizontal" Rotation="90" />
文章标题:矢量字体图标FontAwesome.WPF
文章链接:http://soscw.com/index.php/essay/88453.html