图标库
Icons may be small, but they are powerful forms of communication in today’s digital age.
图标可能很小,但它们是当今数字时代强大的沟通形式。
pictogrammers.com/library/mdi/
github.com/MahApps/MahApps.Metro.IconPacks
在WPF中快速开始
方法1
<Viewbox Width="48" Height="48">
<Canvas Width="24" Height="24">
<Path Data="M...Z" Fill="Black" />
</Canvas>
</Viewbox>
方法2
<UserControl>
<UserControl.Resources>
<PathGeometry x:Key="MyPath" Figures="M...Z" />
</UserControl.Resources>
...
<Viewbox Width="48" Height="48">
<Canvas Width="24" Height="24">
<Path Data="{StaticResource MyPath}" Fill="Black" />
</Canvas>
</Viewbox>
方法3
<materialDesign:PackIcon Kind="Account" />
方法4
Install-Package SharpVectors
<Button Width="80" Height="40">
<svgc:SvgViewbox IsHitTestVisible="False" Source="pack://application:,,,/1.svg"/>
</Button>
方法5: Svg 转 png
Install-Package Svg
原尺寸大小:
var svg = SvgDocument.Open(@"....svg");
using var bmp = svg.Draw();
bmp.Save("....png");
缩放处理:
var svg = SvgDocument.Open(@"....svg");
float width = svg.ViewBox.Width * 5;
float height = svg.ViewBox.Height * 5;
using var bmp = svg.Draw((int)width,(int)height);
bmp.Save("....png");