How to draw a drop-shadow on a transparent rectangle?

后端 未结 4 1789
没有蜡笔的小新
没有蜡笔的小新 2021-01-06 07:55

When I add a dropshadow bitmap effect to a rectangle, the dropshadow takes into account the transparency of the rectangle (makes sense). Is there a way to render a dropshado

4条回答
  •  遥遥无期
    2021-01-06 08:12

    Drop this into Kaxaml. It creates a transparent Rectangle of size 500x500, with a SystemDropShadowChrome Decorator. The drop shadow's clip is set to exclude the Rectangle's region.

    
        
            
                
                
                    
                        
                            
                        
                        
                            
                        
                    
                
            
        
    
    

    If you want your drop shadow to have rounded corners, then set the CornerRadius of the SystemDropShadowChrome to whatever (let's say 10), then Geometry1's Left and Top values to 10, then the RadiusX and RadiusY of each RectangleGeometry to 10.

提交回复
热议问题