wpf将svg的多个path数据转为wpf的矢量Path几何图形数据

svg数据

bash 复制代码
<svg t="1770611364147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6161" width="32" height="32"><path d="M370.346667 297.642667m-196.608 0a196.608 196.608 0 1 0 393.216 0 196.608 196.608 0 1 0-393.216 0Z" fill="#467DB9" p-id="6162"></path><path d="M638.976 898.730667c-53.930667-59.392-89.770667-128.341333-110.933333-205.482667-9.898667-35.498667-16.042667-71.338667-19.114667-107.52-44.032 23.210667-94.549333 36.181333-147.797333 36.181333-60.416 0-117.077333-16.725333-165.205334-46.08h-9.898666C87.381333 575.829333 6.826667 656.384 6.826667 755.029333V836.266667c0 47.786667 39.253333 87.04 87.04 87.04h569.344c-8.533333-7.850667-16.384-16.042667-24.234667-24.576zM1016.149333 546.133333c-1.365333-17.408-12.288-28.672-29.696-29.013333-16.384-0.341333-32.426667-1.365333-48.810666-4.096-42.666667-7.168-82.261333-22.186667-118.442667-45.397333-2.389333-1.365333-4.778667-2.730667-7.168-3.413334-9.216-3.072-18.090667-1.365333-26.282667 3.754667-40.96 25.941333-85.333333 41.984-133.461333 47.104-11.946667 1.365333-24.234667 1.365333-36.181333 2.389333-13.653333 1.024-24.917333 11.946667-25.941334 25.6-0.682667 10.922667-1.024 21.845333-1.706666 32.768 0.341333 38.229333 5.12 76.117333 15.36 112.981334 15.36 55.637333 41.642667 105.813333 80.554666 148.821333 30.037333 33.109333 65.194667 58.709333 105.813334 77.141333 8.533333 3.754667 17.066667 4.096 25.6 0.341334 44.714667-20.138667 83.285333-49.152 114.688-87.04 51.541333-61.781333 77.824-133.802667 85.333333-213.333334 1.706667-22.869333 2.048-45.738667 0.341333-68.608z m-44.032 84.309334c-5.802667 62.805333-26.624 119.808-67.584 168.618666-24.917333 30.037333-55.296 52.906667-90.794666 68.949334-4.437333 2.048-8.533333 2.730667-12.970667 2.048V510.293333c3.413333-0.341333 6.826667-0.341333 10.581333 1.024 2.048 0.682667 3.754667 1.706667 5.461334 2.730667 28.672 18.432 60.074667 30.378667 93.866666 35.84 12.629333 2.048 25.6 3.072 38.570667 3.413333 13.653333 0.341333 22.528 9.216 23.552 22.869334 1.024 18.090667 1.024 36.181333-0.682667 54.272z" fill="#467DB9" p-id="6163"></path></svg>

多个path数据转换为wpf中style样式表的几何图形数据

bash 复制代码
<UserControl.Resources>
 
  <GeometryGroup x:Key="UserShield">   
       <Geometry>M370.346667 297.642667m-196.608 0a196.608 196.608 0 1 0 393.216 0 196.608 196.608 0 1 0-393.216 0Z</Geometry>
       <Geometry>M638.976 898.730667c-53.930667-59.392-89.770667-128.341333-110.933333-205.482667-9.898667-35.498667-16.042667-71.338667-19.114667-107.52-44.032 23.210667-94.549333 36.181333-147.797333 36.181333-60.416 0-117.077333-16.725333-165.205334-46.08h-9.898666C87.381333 575.829333 6.826667 656.384 6.826667 755.029333V836.266667c0 47.786667 39.253333 87.04 87.04 87.04h569.344c-8.533333-7.850667-16.384-16.042667-24.234667-24.576zM1016.149333 546.133333c-1.365333-17.408-12.288-28.672-29.696-29.013333-16.384-0.341333-32.426667-1.365333-48.810666-4.096-42.666667-7.168-82.261333-22.186667-118.442667-45.397333-2.389333-1.365333-4.778667-2.730667-7.168-3.413334-9.216-3.072-18.090667-1.365333-26.282667 3.754667-40.96 25.941333-85.333333 41.984-133.461333 47.104-11.946667 1.365333-24.234667 1.365333-36.181333 2.389333-13.653333 1.024-24.917333 11.946667-25.941334 25.6-0.682667 10.922667-1.024 21.845333-1.706666 32.768 0.341333 38.229333 5.12 76.117333 15.36 112.981334 15.36 55.637333 41.642667 105.813333 80.554666 148.821333 30.037333 33.109333 65.194667 58.709333 105.813334 77.141333 8.533333 3.754667 17.066667 4.096 25.6 0.341334 44.714667-20.138667 83.285333-49.152 114.688-87.04 51.541333-61.781333 77.824-133.802667 85.333333-213.333334 1.706667-22.869333 2.048-45.738667 0.341333-68.608z m-44.032 84.309334c-5.802667 62.805333-26.624 119.808-67.584 168.618666-24.917333 30.037333-55.296 52.906667-90.794666 68.949334-4.437333 2.048-8.533333 2.730667-12.970667 2.048V510.293333c3.413333-0.341333 6.826667-0.341333 10.581333 1.024 2.048 0.682667 3.754667 1.706667 5.461334 2.730667 28.672 18.432 60.074667 30.378667 93.866666 35.84 12.629333 2.048 25.6 3.072 38.570667 3.413333 13.653333 0.341333 22.528 9.216 23.552 22.869334 1.024 18.090667 1.024 36.181333-0.682667 54.272z</Geometry>
  </GeometryGroup>
  
</UserControl.Resources>

页面使用样式 UserShield

bash 复制代码
<Grid  Width="20"  Height="20" >
<Path
	Data="{StaticResource UserShield}"
	Fill="Blue"
	Stretch="Uniform" />
</Grid>
相关推荐
精神底层1 小时前
拒绝 UI 卡死!我用 CSnakes 实时拦截 Python 训练流,在 WPF 中重构了 ScottPlot 5 高性能 AI 看板
python·ui·wpf
贪玩的小松鼠1 天前
WPF基础到企业应用系列7——深入剖析依赖属性(WPF/Silverlight核
wpf
界面开发小八哥1 天前
界面控件DevExpress WPF v26.1新版亮点 - TreeView、Spreadsheet控件功能升级
.net·wpf·界面控件·devexpress·ui开发
斯文的八宝粥2 天前
WPF企业内训全程实录(下)
大数据·hadoop·wpf
精明的身影4 天前
深入WPF -- Dispatcher(补)
wpf
云中飞鸿5 天前
该如何进行WPF界面设计
wpf
云中飞鸿6 天前
WPF分哪几块
wpf
newbe365246 天前
我们如何使用 impeccable 优化前端界面设计与实现稳定性
前端·人工智能·分布式·github·aigc·wpf
Chris _data24 天前
WPF 学习第三天 — Modbus RTU 串口通信
hadoop·学习·wpf
布吉岛的石头25 天前
Java 程序员第 43 阶段05:微服务整合大模型,跨服务调用架构设计实战,Seata分布式事务实战
wpf