圆形窗口阴影效果 [英] Circular window drop shadow effect

查看:100
本文介绍了圆形窗口阴影效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下窗口代码,在透明方形窗口中有一个圆形边框,给出圆形窗口的效果。如何获得圆形阴影,这实际上是圆圈向右下方的偏移。我已尝试
各种dropShadow效果在边框上但无法获得圆形投影。



非常感谢


< Window x:Class =" UserTraining.ConfirmRestartWindow" 
xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x =" http://schemas.microsoft.com/winfx/2006/xaml"
Title =" Window1"宽度= QUOT; 220"搜索Google。溢出
允许透明度="真实"
ResizeMode =" NoResize" ShowInTaskbar = QUOT假QUOT;最上面= QUOT;真" WindowStyle = QUOT;无"高度= QUOT; 220"背景= QUOT;透明" ShowActivated = QUOT假QUOT;
WindowStartupLocation =" CenterScreen" >

< Grid>
< Border BorderBrush =" Black"了borderThickness = QUOT; 1,1,1,1" CornerRadius = QUOT; 140140140140" >
< Border.Background>
< ImageBrush ImageSource =" Saturn.png">< / ImageBrush>
< /Border.Background>
< / Border>
< / Grid>
< / Window>

解决方案

您好scocia888,


您可以尝试以下代码:

 <网格和GT; 
< Border
BorderBrush =" Black"
BorderThickness =" 1,1,1,1"
CornerRadius =" 140,140,​​140,​​140">
< Border.Effect>
< DropShadowEffect />
< /Border.Effect>

< Border.Background>
< ImageBrush ImageSource =" /Photo/1.jpg" />
< /Border.Background>
< / Border>
< / Grid>

最好的问候,


Cherry



I have the following window code which has a circular border within a transparent square window giving the effect of a circular window. How do I get a Circular drop shadow which is effectively an offset of the circle towards the bottom right. I have tried all sorts of dropShadow effects on the borders but unable to get a circular drop shadow.

Many thanks

<Window x:Class="UserTraining.ConfirmRestartWindow"    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
    Title="Window1" Width="220" Search Google. Overflow
    AllowsTransparency="True"        
    ResizeMode="NoResize" ShowInTaskbar="False" Topmost="True" WindowStyle="None" Height="220" Background="Transparent" ShowActivated="False" 
        WindowStartupLocation="CenterScreen" >
    
    <Grid >
        <Border BorderBrush="Black" BorderThickness="1,1,1,1" CornerRadius="140,140,140,140" >           
            <Border.Background>
                <ImageBrush ImageSource="Saturn.png"></ImageBrush>
            </Border.Background>           
        </Border>               
    </Grid>
</Window>

解决方案

Hi scocia888,

You can try the following code:

  <Grid>
        <Border
            BorderBrush="Black"
            BorderThickness="1,1,1,1"
            CornerRadius="140,140,140,140">
            <Border.Effect>
                <DropShadowEffect />
            </Border.Effect>

            <Border.Background>
                <ImageBrush ImageSource="/Photo/1.jpg" />
            </Border.Background>
        </Border>
    </Grid>

Best Regards,

Cherry


这篇关于圆形窗口阴影效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆