成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Windows Phone開發(33):路徑之其它Geometry

移動開發
Windows Phone具有桌面定制、圖標拖拽、滑動控制等一系列前衛的操作體驗。其主屏幕通過提供類似儀表盤的體驗來顯示新的電子郵件、短信、未接來電、日歷約會等,讓人們對重要信息保持時刻更新。

上一節中,我們把最復雜的PathGeometry給干了,生剩下幾個家伙就好辦事了。一起來見見他們的真面目吧。

一、LineGeometry

這個幾何圖形就很簡單了,一條線段,兩個點——StartPoint And EndPoint。

一起來看看下面的例子。

  1. <Path Grid.Column="0" Grid.Row="0">   
  2.     <Path.Data>   
  3.         <LineGeometry StartPoint="20,5" EndPoint="200,320"/>   
  4.     </Path.Data>   
  5. </Path>   

運行之后你會看到以下情景:

二、RectangleGeometry

它呈現一人矩形的幾何圖形,Rect指示其中矩形的位置大小,在XAML中可以用4個數值表示,即X、Y、Width、Height;別外,RadiusX和RadiusY表示圓角在X軸和Y軸上的半徑。看下面的例子。

  1. <Path Grid.Column="1" Grid.Row="0">   
  2.     <Path.Data>   
  3.         <RectangleGeometry Rect="12,6,125,90" RadiusX="24" RadiusY="30"/>   
  4.     </Path.Data>   
  5. </Path>   

運行效果如下圖所示。

三、EllipseGeometry

表示一個橢圓的幾何圖形,Center屬性為橢圓的中心點的坐標,RadiusX和RadiusY分別為X軸方向上和Y軸方向上的半徑長度。看例子。

  1. <Path Grid.Column="0" Grid.Row="1">   
  2.     <Path.Data>   
  3.         <EllipseGeometry Center="100,180" RadiusX="55" RadiusY="120"/>   
  4.     </Path.Data>   
  5. </Path> 

運行效果如下:

四、GeometryGroup

嚴格上說,它不屬性一種幾何圖形,但它很有用,因為它可以同時包含N個幾何圖形,如下面例子所示。

  1. <Path Grid.Column="1" Grid.Row="1">   
  2.     <Path.Data>   
  3.         <GeometryGroup>   
  4.             <LineGeometry StartPoint="32,185" EndPoint="180,230"/>   
  5.             <RectangleGeometry Rect="35,85,136,96" RadiusX="25" RadiusY="5"/>   
  6.             <EllipseGeometry Center="112,130" RadiusX="45" RadiusY="36"/>   
  7.         </GeometryGroup>   
  8.     </Path.Data>   
  9. </Path>   

運行效是如下所示:

下面是本節示例的完整XAML代碼。

  1. <phone:PhoneApplicationPage    
  2.     x:Class="Sample.MainPage"   
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
  5.     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"   
  6.     xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"   
  7.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
  8.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
  9.     mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"   
  10.     FontFamily="{StaticResource PhoneFontFamilyNormal}"   
  11.     FontSize="{StaticResource PhoneFontSizeNormal}"   
  12.     Foreground="{StaticResource PhoneForegroundBrush}"   
  13.     SupportedOrientations="Portrait" Orientation="Portrait"   
  14.     shell:SystemTray.IsVisible="True">   
  15.    
  16.     <phone:PhoneApplicationPage.Resources>   
  17.         <Style TargetType="Path">   
  18.             <Setter Property="HorizontalAlignment" Value="Stretch"/>   
  19.             <Setter Property="VerticalAlignment" Value="Stretch"/>   
  20.             <Setter Property="Margin" Value="20"/>   
  21.             <Setter Property="Stroke" Value="Blue"/>   
  22.             <Setter Property="StrokeThickness" Value="8"/>   
  23.         </Style>   
  24.     </phone:PhoneApplicationPage.Resources>   
  25.        
  26.     <Grid>   
  27.         <Grid.ColumnDefinitions>   
  28.             <ColumnDefinition Width="*"/>   
  29.             <ColumnDefinition Width="*"/>   
  30.         </Grid.ColumnDefinitions>   
  31.         <Grid.RowDefinitions>   
  32.             <RowDefinition Height="*"/>   
  33.             <RowDefinition Height="*"/>   
  34.         </Grid.RowDefinitions>   
  35.         <Path Grid.Column="0" Grid.Row="0">   
  36.             <Path.Data>   
  37.                 <LineGeometry StartPoint="20,5" EndPoint="200,320"/>   
  38.             </Path.Data>   
  39.         </Path>   
  40.         <Path Grid.Column="1" Grid.Row="0">   
  41.             <Path.Data>   
  42.                 <RectangleGeometry Rect="12,6,125,90" RadiusX="24" RadiusY="30"/>   
  43.             </Path.Data>   
  44.         </Path>   
  45.         <Path Grid.Column="0" Grid.Row="1">   
  46.             <Path.Data>   
  47.                 <EllipseGeometry Center="100,180" RadiusX="55" RadiusY="120"/>   
  48.             </Path.Data>   
  49.         </Path>   
  50.         <Path Grid.Column="1" Grid.Row="1">   
  51.             <Path.Data>   
  52.                 <GeometryGroup>   
  53.                     <LineGeometry StartPoint="32,185" EndPoint="180,230"/>   
  54.                     <RectangleGeometry Rect="35,85,136,96" RadiusX="25" RadiusY="5"/>   
  55.                     <EllipseGeometry Center="112,130" RadiusX="45" RadiusY="36"/>   
  56.                 </GeometryGroup>   
  57.             </Path.Data>   
  58.         </Path>   
  59.     </Grid>   
  60. </phone:PhoneApplicationPage>   

 

責任編輯:閆佳明 來源: oschina
相關推薦

2013-04-19 17:11:02

Windows PhoWindows Pho

2013-04-23 16:59:22

Windows Pho路徑標記語法

2013-07-31 13:13:50

Windows PhoMVVM模式

2013-04-24 13:31:59

Windows Pho動畫之ColorAni

2013-04-24 13:19:06

Windows Pho動畫DoubleAni

2013-04-24 13:43:10

Windows Pho動畫PointAnim

2013-07-31 13:36:07

Windows PhoVS調試技巧Windows Pho

2013-07-30 12:37:56

Windows PhoWindows Pho

2010-04-21 17:07:54

Windows Pho

2013-04-17 14:00:06

Windows PhoWindows Pho

2011-06-07 12:42:15

Windows Pho

2013-04-16 17:02:50

Windows Pho概論

2013-04-19 16:34:56

Windows PhoWindows Pho

2013-07-30 11:18:37

Windows PhoWindows Pho

2010-08-06 15:44:28

Windows PhoWindows PhoSilverlight

2010-04-08 17:40:23

Windows Pho

2010-07-16 15:29:02

Windows Pho

2012-08-16 10:35:50

Windows Pho

2011-06-07 11:35:38

Windows Pho

2013-04-17 13:27:04

Windows PhoWindows Pho
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 欧美成人激情 | 麻豆毛片 | 欧美激情国产日韩精品一区18 | 亚洲一区二区三区视频免费观看 | 一本大道久久a久久精二百 欧洲一区二区三区 | 免费观看成人鲁鲁鲁鲁鲁视频 | 精品欧美一区二区在线观看 | 日韩欧美在线观看 | 久久福利电影 | 国产精品久久久久久久久久久免费看 | 日本天堂一区 | 久久久久久黄 | 亚洲第一成年免费网站 | 精品一区二区三区在线观看国产 | 黄色av网站免费看 | 春色av| www.亚洲| 啪一啪| 天天夜碰日日摸日日澡 | 欧美日韩三区 | 日韩精品亚洲专区在线观看 | 成人毛片视频在线播放 | 国产成人99久久亚洲综合精品 | 在线中文视频 | 久久久久亚洲精品国产 | 欧美aaaaaaaa| 精品二区视频 | 国产精品女人久久久 | 一区精品国产欧美在线 | 91文字幕巨乱亚洲香蕉 | 超碰免费在 | 国产一区二区三区视频 | 亚洲国产成人av好男人在线观看 | 欧美视频免费在线 | 午夜视频网 | 中文字幕免费视频 | 2020天天操| 亚洲欧美中文日韩在线v日本 | 亚洲成人国产精品 | 2018中文字幕第一页 | 国产精品视频播放 |