使用 Blend 来创建一个不规则 Border
来源:互联网 发布:java getinstance 编辑:程序博客网 时间:2024/05/01 08:00
假设我们有一个空白项,对应的Xaml文件为:
<UserControlxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"x:Class="SilverlightApplication4.MainPage"Width="640" Height="480"><Grid x:Name="LayoutRoot" Background="White"/>UserControl>
我们在其中增加一个 Border 控件,并用 钢笔或者铅笔画一个不规则图形。
这时候,产生的Xaml 文件类似如下:
<UserControlxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"x:Class="SilverlightApplication4.MainPage"Width="640" Height="480"><Grid x:Name="LayoutRoot" Background="White"><Border Height="115" Margin="103,47,102,0" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="1"><Path Fill="White" Stretch="Fill" Stroke="Black" Margin="73.5,35.598,149.5,12.5" UseLayoutRounding="False"
Data="M83,46 C228,18 284,65 284,65 L217,100.99988 L177,79.999947 L141,93.999901 L75,76.999962 z"/>Border>Grid>UserControl>
然后我们在“对象和时间线中”选择我们要用的Path 对象,如下图:
点击 路径 --》 生成剪切路径
在出现的 生成剪切路径选择窗口中,我们选择需要使用这个路径的对象,这里我们选择“Border” 对象
点击确定后,我们就可以获得一个不规则的 Border, 这时候的Xaml 文件为:
<UserControlxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"x:Class="SilverlightApplication4.MainPage"Width="640" Height="480"><Grid x:Name="LayoutRoot" Background="White"><Border Height="115" Margin="103,47,102,0" VerticalAlignment="Top" BorderBrush="Black" BorderThickness="1"
Clip="M83,45.999935 C228,17.999838 284,65 284,65 L217,101 L177,80 L141,94 L75,77 z"/>Grid>UserControl>
适当调整颜色后,看到的Border 就是如下图:
其他控件我们想要设计成不规则方式, 在Blend 中的设计步骤类似。
参考资料:
请教怎样用path做一个不规则的border
http://topic.csdn.net/u/20091216/15/9585d9b5-5fb9-4fe0-bb24-5cd9f5a1b46c.html
- 使用 Blend 来创建一个不规则 Border
- Silverlight - Tip: 使用Expression Blend 创建一个扇形
- Blend创建一个自定义按钮
- 通过Expression Blend创建一个Lightswitch Theme
- 使用C#创建不规则窗体
- 使用 XAML 和 Expression Blend 创建动画
- 演练:使用 Microsoft Expression Blend 创建按钮
- VC---创建一个不规则形状的窗口
- 如何创建一个不规则形状的窗口
- 使用ATL类来创建一个对话框
- 使用Spring来创建一个简
- 使用easyUI创建一个border layout在你的web页面
- 使用图片创建不规则窗体 windows sdk
- 使用图片创建不规则窗体 windows sdk
- 使用图片创建不规则窗体 windows sdk
- 使用CSS 3创建不规则图形
- 使用CSS 3创建不规则图形
- 使用CSS 3创建不规则图形
- 应用程序测试经验漫谈(3)--兼容性
- 2009十大网络流行语 中英文对照读本 (搞笑)
- Eclipse插件开发引用外部包
- XP sp3 安装iis时找不到zClientm.exe的解决方法
- Silverlight 的 Border 控件
- 使用 Blend 来创建一个不规则 Border
- Silverlight 图形的转换
- 102 种博客标题格式
- Windows的用户管理中的用户模拟 impersonate
- sp_spaceused (Transact-SQL)
- 一个通讯录代码。提供参考,写的既不像c,又不像c++
- fatal error LNK1112: module machine type 'THUMB' conflicts with target machine type 'ARM'
- windows 2003/2008 禁用关闭事件跟踪程序 自动登录 禁用 IE 增强的安全配置
- 我们公司的新产品-创建你所需要的应用系统。