使用Expression Design 4生成的矢量图形来作为图标和背景

生成选项可以是资源文件和Canvas。使用资源来运用。

app.xaml中:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Pictures/icon.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

icon.xaml中:

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 3     <Canvas x:Key="title_icon" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="573" Height="463" Clip="F1 M 0,0L 573,0L 573,463L 0,463L 0,0">
 4         <Rectangle Width="161" Height="247" Canvas.Left="20" Canvas.Top="-1.90735e-005" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFF53F3F"/>
 5         <Rectangle Width="399" Height="101" Canvas.Left="90" Canvas.Top="68" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFF53F3F"/>
 6         <Rectangle Width="573" Height="117" Canvas.Left="0" Canvas.Top="214" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFF53F3F"/>
 7         <Rectangle Width="111" Height="183" Canvas.Left="384" Canvas.Top="270" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFF53F3F"/>
 8         <Rectangle Width="151" Height="179" Canvas.Left="44" Canvas.Top="284" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFF53F3F"/>
 9     </Canvas>
10 </ResourceDictionary>

MainWindow.xaml中:

<Viewbox Margin="3" Child="{StaticResource title_icon}"/>

 

转载于:https://www.cnblogs.com/Markshome/p/7705463.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值