用XAML做网页!!—广告展示区

原文:用XAML做网页!!—广告展示区
 

 

此次我们来进行广告展示区块的制作。

 

首先在Show区块中去掉原来设置的背景色,加入新的渐变背景设定:

 

 

 

<Grid.Background>

<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">

<GradientStop Color="#FFE2C7BC" Offset="1" />

<GradientStop Color="#FFD0D0D0" Offset="0.7" />

<GradientStop Color="#FFF5F5F5" Offset="0" />

</LinearGradientBrush>

</Grid.Background>

 

 

可以看到,它在最底部是微微泛红的:

 

 

这样是模拟了橙色导航栏映射到这里的漫反射效果,增加了材质的金属质感。

 

而后我们将建立如下图所示的Grid格子,他能帮我们更好地安排内容:

 

 

代码如下:

 

 

<Grid.Background>

<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">

<GradientStop Color="#FFE2C7BC" Offset="1" />

<GradientStop Color="#FFD0D0D0" Offset="0.7" />

<GradientStop Color="#FFF5F5F5" Offset="0" />

</LinearGradientBrush>

</Grid.Background>

 

 

在两侧填入两个矩形实现边缘阴影:

 

 

<Rectangle Opacity="0.5" Fill="{StaticResource ShadowLeft}" Grid.Column="0" Grid.RowSpan="3"/>

<Rectangle Opacity="0.5" Fill="{StaticResource ShadowRight}" Grid.Column="3" Grid.RowSpan="3"/>

 

 

接下来是布置背景中闪动的圆形:

 

 

Code
<Ellipse Margin="80,1,0,0" Height="164" Width="164" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Left" VerticalAlignment="Top">

<Ellipse.Triggers>

<EventTrigger RoutedEvent="FrameworkElement.Loaded">

<EventTrigger.Actions>

<BeginStoryboard>

<Storyboard>

<ColorAnimationUsingKeyFrames Duration="0:0:1.8" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

<DiscreteColorKeyFrame KeyTime="0:0:1.7" Value="#5FFF"/>

</ColorAnimationUsingKeyFrames>

</Storyboard>

</BeginStoryboard>

</EventTrigger.Actions>

</EventTrigger>

</Ellipse.Triggers>

</Ellipse>

<Ellipse Margin="310,-111,0,0" Height="224" Width="224" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Left" VerticalAlignment="Top">

<Ellipse.Triggers>

<EventTrigger RoutedEvent="FrameworkElement.Loaded">

<EventTrigger.Actions>

<BeginStoryboard>

<Storyboard>

<ColorAnimationUsingKeyFrames Duration="0:0:1.5" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

<DiscreteColorKeyFrame KeyTime="0:0:1.1" Value="#5FFF"/>

</ColorAnimationUsingKeyFrames>

</Storyboard>

</BeginStoryboard>

</EventTrigger.Actions>

</EventTrigger>

</Ellipse.Triggers>

</Ellipse>

<Ellipse Margin="0,41,560,0" Height="77" Width="77" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Right" VerticalAlignment="Top">

<Ellipse.Triggers>

<EventTrigger RoutedEvent="FrameworkElement.Loaded">

<EventTrigger.Actions>

<BeginStoryboard>

<Storyboard>

<ColorAnimationUsingKeyFrames Duration="0:0:1" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

<DiscreteColorKeyFrame KeyTime="0:0:0.7" Value="#5FFF"/>

</ColorAnimationUsingKeyFrames>

</Storyboard>

</BeginStoryboard>

</EventTrigger.Actions>

</EventTrigger>

</Ellipse.Triggers>

</Ellipse>

<Ellipse Margin="0,-41,10,0" Height="264" Width="264" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Right" VerticalAlignment="Top">

<Ellipse.Triggers>

<EventTrigger RoutedEvent="FrameworkElement.Loaded">

<EventTrigger.Actions>

<BeginStoryboard>

<Storyboard>

<ColorAnimationUsingKeyFrames Duration="0:0:2" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

<DiscreteColorKeyFrame KeyTime="0:0:1.8" Value="#5FFF"/>

</ColorAnimationUsingKeyFrames>

</Storyboard>

</BeginStoryboard>

</EventTrigger.Actions>

</EventTrigger>

</Ellipse.Triggers>

</Ellipse>

 

看上去有些冗长,其实就是4个不同尺寸、位置及不同动画发动时间的圆形而已。

 

现在就是这样了:

 

 

剩下来就是一些文字,在此之前我们先用 Microsoft Expression Design 设计个跳转链接的指示图标:

 

 

这是从一个圆形路径中减去一个三角形得到的,用过 Adobe Illustrator 的话应该很熟悉这方法。

 

将其划出切片,导出为go.xaml,其代码如下:

 

 

Code
<?xml version="1.0" encoding="utf-8"?>

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<DrawingBrush x:Key="go" Stretch="Uniform">

<DrawingBrush.Drawing>

<DrawingGroup ClipGeometry="F1 M 0,0L 40,0L 40,40L 0,40L 0,0">

<DrawingGroup.Children>

<GeometryDrawing Brush="#FFFFFFFF" Geometry="M 20,0C 31.0457,0 40,8.95428 40,20C 40,31.0457 31.0457,40 20,40C 8.95428,40 0,31.0457 0,20C 0,8.95428 8.95428,0 20,0 Z M 32.0941,20L 13.9059,9.49902L 13.9059,30.501L 32.0941,20 Z "/>

</DrawingGroup.Children>

</DrawingGroup>

</DrawingBrush.Drawing>

</DrawingBrush>

</ResourceDictionary>

 

 

将其引入Page的资源:

 

 

 

<ResourceDictionary Source="go.xaml"/>

 

 

然后再将这两个文本块加入Show区块之中:

 

 

<TextBlock Margin="45,0,0,0" FontWeight="Bold" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2">

<Run Foreground="#FFBCBCBC" FontSize="16">摆脱臃肿的邮件客户端和繁复的网页登陆</Run>

<LineBreak/>

<Run Foreground="#FF9A9A9A" FontSize="32">发邮件是可以如此轻松畅快!</Run>

</TextBlock>

<TextBlock Margin="15,0,0,0" Grid.Column="2" Grid.Row="2" Grid.RowSpan="2">

<Hyperlink ToolTip="打开下载页面" TargetName="_blank" NavigateUri="http://www.cnblogs.com/SkyD/articles/1264080.html" FontSize="25" FontWeight="Bold" Foreground="#D0FFFFFF">

<Hyperlink.Style>

<Style TargetType="Hyperlink">

<Setter Property="TextBlock.TextDecorations" Value="{x:Null}"/>

</Style>

</Hyperlink.Style>

<Run>立即尝试</Run>

<Rectangle VerticalAlignment="Center" Margin="5,0,0,0" Fill="{StaticResource go}" Height="20" Width="25"/>

</Hyperlink>

</TextBlock>

 

Hyperlink 标记在这里的功能和 HTML 里的 <a> 是等同的,其中的样式设定的功能是去除文本修饰,即下划线。

 

这样就完成了广告展示区的制作,效果:

 

 

完整的设计视图效果:

 

 

至此,主页面的代码:

 

Code
<Page

 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 WindowTitle="MailMail"

 FontFamily="微软雅黑"

 Background="#FF424242"

 SnapsToDevicePixels="True">

    <Page.Resources>

        <ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>

                <ResourceDictionary Source="back.xaml"/>

                <ResourceDictionary Source="logo.xaml"/>

                <ResourceDictionary Source="go.xaml" />

            </ResourceDictionary.MergedDictionaries>

        </ResourceDictionary>

    </Page.Resources>

    <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

        <Grid MinHeight="900" MinWidth="1000" Background="{StaticResource back}">

            <Grid.ColumnDefinitions>

                <ColumnDefinition Width="8*"/>

                <ColumnDefinition Width="84*"/>

                <ColumnDefinition Width="8*"/>

            </Grid.ColumnDefinitions>

            <Grid.Resources>

                <LinearGradientBrush x:Key="LightLeft" StartPoint="0,0" EndPoint="1,0">

                    <GradientStop Color="#00FFFFFF" Offset="0.1" />

                    <GradientStop Color="#08FFFFFF" Offset="0.4" />

                    <GradientStop Color="#08FFFFFF" Offset="0.6" />

                    <GradientStop Color="#00FFFFFF" Offset="1" />

                </LinearGradientBrush>

                <LinearGradientBrush x:Key="LightRight" StartPoint="1,0" EndPoint="0,0">

                    <GradientStop Color="#00FFFFFF" Offset="0.1" />

                    <GradientStop Color="#08FFFFFF" Offset="0.4" />

                    <GradientStop Color="#08FFFFFF" Offset="0.6" />

                    <GradientStop Color="#00FFFFFF" Offset="1" />

                </LinearGradientBrush>

                <LinearGradientBrush x:Key="ShadowLeft" StartPoint="0,0" EndPoint="1,0">

                    <GradientStop Color="#00000000" Offset="0.1" />

                    <GradientStop Color="#18000000" Offset="0.4" />

                    <GradientStop Color="#18000000" Offset="0.6" />

                    <GradientStop Color="#00000000" Offset="1" />

                </LinearGradientBrush>

                <LinearGradientBrush x:Key="ShadowRight" StartPoint="1,0" EndPoint="0,0">

                    <GradientStop Color="#00000000" Offset="0.1" />

                    <GradientStop Color="#18000000" Offset="0.4" />

                    <GradientStop Color="#18000000" Offset="0.6" />

                    <GradientStop Color="#00000000" Offset="1" />

                </LinearGradientBrush>

            </Grid.Resources>

            <Rectangle Width="20" Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,0,0">

                <Rectangle.Fill>

                    <LinearGradientBrush StartPoint="1,0" EndPoint="0,0">

                        <GradientStop Color="#00000000" Offset="1" />

                        <GradientStop Color="#20000000" Offset="0" />

                    </LinearGradientBrush>

                </Rectangle.Fill>

            </Rectangle>

            <Rectangle Width="20" Grid.Column="3" HorizontalAlignment="Left" Margin="0,0,0,0">

                <Rectangle.Fill>

                    <LinearGradientBrush StartPoint="1,0" EndPoint="0,0">

                        <GradientStop Color="#00000000" Offset="0" />

                        <GradientStop Color="#20000000" Offset="1" />

                    </LinearGradientBrush>

                </Rectangle.Fill>

            </Rectangle>

            <DockPanel Background="#FFF" Grid.Column="1">

                <DockPanel x:Name="Head" DockPanel.Dock="Top" Background="#FF4A4A4A" Height="115">

                    <Rectangle DockPanel.Dock="Left" Width="16" Fill="{StaticResource LightLeft}"/>

                    <Rectangle DockPanel.Dock="Right" Width="16" Fill="{StaticResource LightRight}"/>

                    <Rectangle Fill="{StaticResource logo}" Margin="0" Width="300" Height="125" DockPanel.Dock="Left" />

                    <Rectangle Height="75" Width="1" DockPanel.Dock="Left">

                        <Rectangle.Fill>

                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">

                                <GradientStop Color="#03FFFFFF" Offset="0" />

                                <GradientStop Color="#5DFFFFFF" Offset="0.5" />

                                <GradientStop Color="#00FFFFFF" Offset="1" />

                            </LinearGradientBrush>

                        </Rectangle.Fill>

                    </Rectangle>

                    <Canvas ClipToBounds="True">

                        <Canvas.Background>

                            <RadialGradientBrush RadiusX="0.395548" RadiusY="0.952428" Center="0.343334,0.578031" GradientOrigin="0.543334,0.578031">

                                <RadialGradientBrush.GradientStops>

                                    <GradientStop Color="#23FFFCE5" Offset="0" />

                                    <GradientStop Color="#00FFFFFF" Offset="1" />

                                </RadialGradientBrush.GradientStops>

                                <RadialGradientBrush.RelativeTransform>

                                    <TransformGroup>

                                        <SkewTransform CenterX="0.343334" CenterY="0.578031" AngleX="-6.15299" AngleY="0" />

                                        <RotateTransform CenterX="0.343334" CenterY="0.578031" Angle="-6.59875" />

                                    </TransformGroup>

                                </RadialGradientBrush.RelativeTransform>

                            </RadialGradientBrush>

                        </Canvas.Background>

                        <Label Margin="52,-177,0,0" Foreground="#09FFFFFF" FontFamily="Nina" FontWeight="Bold" FontSize="354">

                            <Label.RenderTransform>

                                <RotateTransform Angle="0" CenterX="172" CenterY="240" />

                            </Label.RenderTransform>

                            <Label.Triggers>

                                <EventTrigger RoutedEvent="FrameworkElement.Loaded">

                                    <EventTrigger.Actions>

                                        <BeginStoryboard>

                                            <Storyboard>

                                                <DoubleAnimation To="360" Duration="0:0:10" RepeatBehavior="Forever" Storyboard.TargetProperty="(Label.RenderTransform).(RotateTransform.Angle)" />

                                            </Storyboard>

                                        </BeginStoryboard>

                                    </EventTrigger.Actions>

                                </EventTrigger>

                            </Label.Triggers>

                            @

                        </Label>

                        <Label Margin="312,35,0,0" Foreground="#61000000" FontFamily="Nina" FontWeight="Bold" FontSize="44">You@^^</Label>

                        <Label Margin="32,57,0,0" Foreground="#AFC3C3C3" FontWeight="Bold" FontSize="16">

                            妙趣轻松,让好心情随邮件散播世界!

                        </Label>

                    </Canvas>

                </DockPanel>

                <Border x:Name="HeadLine" BorderThickness="0,1" DockPanel.Dock="Top" Height="15">

                    <Border.BorderBrush>

                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">

                            <GradientStop Color="#D81B1B1B" Offset="0" />

                            <GradientStop Color="#FFF" Offset="1" />

                        </LinearGradientBrush>

                    </Border.BorderBrush>

                    <Border.Background>

                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">

                            <GradientStop Color="#FF9D9D9D" Offset="0" />

                            <GradientStop Color="#FF808080" Offset="0.005" />

                            <GradientStop Color="#FF9D9D9D" Offset="0.05" />

                            <GradientStop Color="#FF9D9D9D" Offset="0.95" />

                            <GradientStop Color="#FF808080" Offset="0.995" />

                            <GradientStop Color="#FF9D9D9D" Offset="1" />

                        </LinearGradientBrush>

                    </Border.Background>

                </Border>

                <Grid x:Name="Show" DockPanel.Dock="Top" Height="135" ClipToBounds="True">

                    <Grid.Background>

                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">

                            <GradientStop Color="#FFE2C7BC" Offset="1" />

                            <GradientStop Color="#FFD0D0D0" Offset="0.7" />

                            <GradientStop Color="#FFF5F5F5" Offset="0" />

                        </LinearGradientBrush>

                    </Grid.Background>

                    <Grid.ColumnDefinitions>

                        <ColumnDefinition Width="28" />

                        <ColumnDefinition Width="5*" />

                        <ColumnDefinition Width="4*" />

                        <ColumnDefinition Width="28" />

                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>

                        <RowDefinition Height="2*" />

                        <RowDefinition Height="3*" />

                        <RowDefinition Height="4*" />

                    </Grid.RowDefinitions>

                    <Rectangle Opacity="0.5" Fill="{StaticResource ShadowLeft}" Grid.Column="0" Grid.RowSpan="3" />

                    <Rectangle Opacity="0.5" Fill="{StaticResource ShadowRight}" Grid.Column="3" Grid.RowSpan="3" />

                    <Ellipse Margin="80,1,0,0" Height="164" Width="164" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Left" VerticalAlignment="Top">

                        <Ellipse.Triggers>

                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">

                                <EventTrigger.Actions>

                                    <BeginStoryboard>

                                        <Storyboard>

                                            <ColorAnimationUsingKeyFrames Duration="0:0:1.8" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

                                                <DiscreteColorKeyFrame KeyTime="0:0:1.7" Value="#5FFF" />

                                            </ColorAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </BeginStoryboard>

                                </EventTrigger.Actions>

                            </EventTrigger>

                        </Ellipse.Triggers>

                    </Ellipse>

                    <Ellipse Margin="310,-111,0,0" Height="224" Width="224" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Left" VerticalAlignment="Top">

                        <Ellipse.Triggers>

                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">

                                <EventTrigger.Actions>

                                    <BeginStoryboard>

                                        <Storyboard>

                                            <ColorAnimationUsingKeyFrames Duration="0:0:1.5" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

                                                <DiscreteColorKeyFrame KeyTime="0:0:1.1" Value="#5FFF" />

                                            </ColorAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </BeginStoryboard>

                                </EventTrigger.Actions>

                            </EventTrigger>

                        </Ellipse.Triggers>

                    </Ellipse>

                    <Ellipse Margin="0,41,560,0" Height="77" Width="77" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Right" VerticalAlignment="Top">

                        <Ellipse.Triggers>

                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">

                                <EventTrigger.Actions>

                                    <BeginStoryboard>

                                        <Storyboard>

                                            <ColorAnimationUsingKeyFrames Duration="0:0:1" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

                                                <DiscreteColorKeyFrame KeyTime="0:0:0.7" Value="#5FFF" />

                                            </ColorAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </BeginStoryboard>

                                </EventTrigger.Actions>

                            </EventTrigger>

                        </Ellipse.Triggers>

                    </Ellipse>

                    <Ellipse Margin="0,-41,10,0" Height="264" Width="264" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="3" Fill="#49EEEEEE" HorizontalAlignment="Right" VerticalAlignment="Top">

                        <Ellipse.Triggers>

                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">

                                <EventTrigger.Actions>

                                    <BeginStoryboard>

                                        <Storyboard>

                                            <ColorAnimationUsingKeyFrames Duration="0:0:2" RepeatBehavior="Forever" Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">

                                                <DiscreteColorKeyFrame KeyTime="0:0:1.8" Value="#5FFF" />

                                            </ColorAnimationUsingKeyFrames>

                                        </Storyboard>

                                    </BeginStoryboard>

                                </EventTrigger.Actions>

                            </EventTrigger>

                        </Ellipse.Triggers>

                    </Ellipse>

                    <TextBlock Margin="45,0,0,0" FontWeight="Bold" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2">

                      <Run Foreground="#FFBCBCBC" FontSize="16">摆脱臃肿的邮件客户端和繁复的网页登陆</Run>

                      <LineBreak />

                      <Run Foreground="#FF9A9A9A" FontSize="32">发邮件是可以如此轻松畅快!</Run>

                    </TextBlock>

                    <TextBlock Margin="15,0,0,0" Grid.Column="2" Grid.Row="2" Grid.RowSpan="2">

                        <Hyperlink ToolTip="打开下载页面" TargetName="_blank" NavigateUri="http://www.cnblogs.com/SkyD/articles/1264080.html" FontSize="25" FontWeight="Bold" Foreground="#D0FFFFFF">

                            <Hyperlink.Style>

                                <Style TargetType="Hyperlink">

                                    <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />

                                </Style>

                            </Hyperlink.Style>

                            <Run>立即尝试</Run><Rectangle VerticalAlignment="Center" Margin="5,0,0,0" Fill="{StaticResource go}" Height="20" Width="25" />

                        </Hyperlink>

                    </TextBlock>

                </Grid>

                <Border x:Name="Channel" DockPanel.Dock="Top" Height="50" Background="#FF8E45" BorderThickness="0,1,0,0" BorderBrush="#FFF"></Border>

                <Border x:Name="Footer" Background="#666" BorderBrush="#888" BorderThickness="0,4,0,0" DockPanel.Dock="Bottom" Height="55"></Border>

                <DockPanel x:Name="Body" Background="#FFFFFCD1">

                    <DockPanel x:Name="Side" Background="#1E874900" DockPanel.Dock="Right" Width="245"></DockPanel>

                    <StackPanel x:Name="Content"></StackPanel>

                </DockPanel>

            </DockPanel>

        </Grid>

    </ScrollViewer>

</Page>

 

 

源文件下载

时间: 2024-12-28 14:07:15

用XAML做网页!!—广告展示区的相关文章

用XAML做网页!!—导航栏

原文:用XAML做网页!!-导航栏    这次要完成的是导航栏,这是页面中比较复杂的区域.   先在 Microsoft Expression Design 中绘制导航栏的背景图案:       导出为barback.xaml,增加其填充规则:       ViewportUnits="Absolute" Viewport="0,0,15,13.86" TileMode="Tile"     完成后的代码如下:     Code<?xml 

用XAML做网页!!—边栏与页脚

原文:用XAML做网页!!-边栏与页脚 此次我们来设计边栏和页脚,首先从页脚开始,其代码很简单:   <Border x:Name="Footer" BorderBrush="#888" BorderThickness="0,4,0,0" DockPanel.Dock="Bottom" Height="55">     <Border.Background>         <

用XAML做网页!!—开篇

原文:用XAML做网页!!-开篇      这几日一直没发表新文章,一来是因为事比较多,二来就是我在研究使用XAML挑战传统HTML来做网页,这很可能是在全球的首次尝试,至少我从未找到任何可供参考的相关资料.   我对这次挑战的结果打7分:   XAML在页面布局.图形.动画及可控性方面的表现堪称完美,我甚至根本想不出来有什么能与之平分秋色:   兼容性方面,XAML通吃所有Windows平台的各种浏览器,它实际上都是由后台的那个叫"Windows 演示基础主机"来解析和呈现的,所以只

用XAML做网页!!—框架

原文:用XAML做网页!!-框架     上一篇中我进行了一下效果展示和概述,此篇开始将重现我此次尝试的步骤,我想大家通过阅读这些步骤,可以了解到XAML网页排版的方法.   下面就开始编写XAML,首先来定义一下页面的属性:     <Page   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx

用XAML做网页!!—页头

原文:用XAML做网页!!-页头     接续上次进度,我们此次来制作页头.   首先要实现两侧边缘的美化,如下图所示:     在边缘处有一层朦胧的亮度反光效果,这也是通过简单的渐变实现的,而且我们在后面的每个区块中都要实现类似的效果,所以现在就将所需的资源一起创建了.   在Grid中创建一个资源标记,并设置4个笔刷资源:     Code<Grid.Resources> <LinearGradientBrush x:Key="LightLeft" StartPo

新手做网页用什么软件简单易学

要想学习制作网页和学习其它知识一样,是要有基础的.在基础之上学习起来会比较轻松和快捷的.其次,要清楚学习它是用来做什么.   建议你要具备的条件:对电脑熟练操作,使用电脑最好在一年以上,对网页设计感兴趣,有较充足的学习时间,熟悉office办公软件.当然,这些不是一定必须的第一阶段:开始时最好是学些网页编辑软件,如:FrontPage.Dreamweaver.这样可以使您更了解网页制作与运营的原理.最好使拿本教程来学学,结合教程边学习边制作. 第二阶段:会用网页制作软件后,已会制作一个较完整的网

日IP突破1万,谈谈我做网页吧的几点经验

现在在机房给学生上课,累了,我要学生自己练习,机房里有点吵,没办法,借这点时间总结这一年多来做网页吧wangyeba.com的经验. 做网页吧有一年多了,前不久终于日IP突破了1W,难免有几许激动,几许感慨. 很多人都知道,我四年以前是做源码吧的,一个源代码下载站,当时在站长界还算有一点点名气.05年的时候,我突然发现做源代码下载站的太多了,中国的个人站跟风很严重. 这个时候,我开始考虑,我该做点别的了,05年下半年我发现,个人站做源代码的有了,做模板下载的有了,做技术教程的有了,做网站运做的有

JS判断网页广告是否被浏览器拦截过滤的代码

 本来现在投广告赚钱也不像前几年好做,现在还大部分浏览器都拦截了广告,很多浏览器还是默认拦截广告,做站长不是一般辛苦啊!目前中小站长大部分收入还是靠广告,广告被拦截,收入自然会大大减少. 目前大部分浏览器的广告拦截规则都是广告黑名单+一些广告字眼匹配,比如百度联盟.搜狗联盟.Google联盟这些就算在广告黑名单里的,一般广告过滤都会过滤掉这些广告联盟代码.剩下的就是广告字眼匹配,比如js地址包含ads.php.ad.js甚至是gg.js都可能会被过滤,360浏览器甚至会把包含ad.gif.960

编码-django取出pymongo中存储的中文图片路径后,读取该路径在网页上展示没有出现图片

问题描述 django取出pymongo中存储的中文图片路径后,读取该路径在网页上展示没有出现图片 问题是这样的: 我搭建的环境是:python2.7 + mongoengine + pymongo + django + Ubuntu14 python处理一些带有中文路径的图片,把这个路径存储在数据库pymongo中,保存的时候该路径是转换为:utf-8类型存储到数据库中,然后django通过mongoengine来连接pymongo的数据库,从中取出这个图片的路径, 希望向各位朋友们请教一下下