本文介绍了你如何做一个梯度渐变到Aero玻璃在WPF应用程序,如Office 2010的呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写在WPF应用程序,我想从一个颜色的Aero玻璃像Office 2010应用程序具有应用程序褪色的顶部。

I am writing an application in WPF and I would like to have the top of the application fade from a color to Aero glass like the Office 2010 applications.

实际上它会褪色面积仅低于玻璃的标题栏的颜色。 (我认为这可能是更好的方式来形容它)。

Really it will be fading the area just below the title bar from glass to a color. (I think that maybe a better way to describe it).

推荐答案

我想出如何得到它的工作。我设置了整个窗口,必须使用本地的API,然后创建一个LinearGradientBrush我窗口的背景就可以了Aero的玻璃效果。在刷我用刷的alpha属性,设置止损有窗口的顶部从白色/不透明去白/透明都非常靠近窗口的顶部。

I figured out how to get it to work. I set the entire window to have the aero glass effect on it using the native API's and then a create a LinearGradientBrush for my background of the window. In the brush I used the Alpha properties of the brush and set the stops to have the top of the window go from white/opaque to white/transparent all very close to the top of the window.

<Grid>
        <Grid.Background>
            <LinearGradientBrush StartPoint="1,0">
                <!-- This gradient stop is Fully transparent. -->
                <GradientStop Color="#00FFFFFF" Offset="0.0" />
                <!-- This gradient stop is fully opaque. -->
                <GradientStop Color="#FFFFFFFF" Offset="0.1" />
            </LinearGradientBrush>
        </Grid.Background>
</Grid>

我1 up'd米克兰塔宁的答案,因为我以前的文章中添加玻璃效果,我没有在code得心应手,这是一个好简单的文章。

I 1 up'd Mikko Rantanen's answer because I used the article to add the glass effect I didn't have the code handy and it was a good simple article.

这篇关于你如何做一个梯度渐变到Aero玻璃在WPF应用程序,如Office 2010的呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 20:29