Globe.xaml
上传用户:huazai0421
上传日期:2008-05-30
资源大小:405k
文件大小:2k
源码类别:

SilverLight

开发平台:

C#

  1. <Canvas xmlns="http://schemas.microsoft.com/client/2007" 
  2.         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  3.         x:Class="SilverGlobe.Globe"
  4.         Width="160"
  5.         Height="160"
  6. >
  7.     <Canvas.Background>
  8.         <LinearGradientBrush MappingMode="Absolute" StartPoint="0,0" EndPoint="0,160">
  9.             <GradientStop Color="#FFCCCCCC" Offset="0"/>
  10.             <GradientStop Color="White" Offset="0.6"/>
  11.             <GradientStop Color="#FF888888" Offset="1"/>
  12.         </LinearGradientBrush>
  13.     </Canvas.Background>
  14.     <!-- Clip to sphere -->
  15.     <Canvas.Clip>
  16.         <EllipseGeometry Center="80,80" RadiusX="40" RadiusY="40" x:Name="_clip" />
  17.     </Canvas.Clip>
  18.     <Canvas x:Name="_shapes" Width="160" Height="160">
  19.         <Path Fill="#FF606060" Width="160" Height="160" x:Name="Africa" />
  20.         <Path Fill="#FF606060" Width="160" Height="160" x:Name="America" />
  21.         <Path Fill="#FF606060" Width="160" Height="160" x:Name="Australia" />
  22.         <Path Fill="#FF606060" Width="160" Height="160" x:Name="Eurasia" />
  23.         <Path Width="160" Height="160" x:Name="Antarctica" Fill="White" />
  24.     </Canvas>
  25.     <Ellipse Width="100" Height="100"
  26.            RenderTransformOrigin="0.5,0.5" Canvas.Left="0"           
  27.   >
  28.         <Ellipse.Fill>
  29.             <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad">
  30.                 <GradientStop Color="White" Offset="0"/>
  31.                 <GradientStop Color="#0088CCFF" Offset="0.4"/>
  32.             </LinearGradientBrush>
  33.         </Ellipse.Fill>
  34.         <Ellipse.RenderTransform>
  35.             <ScaleTransform x:Name="_glossScale" />
  36.         </Ellipse.RenderTransform>
  37.     </Ellipse>
  38. </Canvas>