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

后端 未结 4 1770
没有蜡笔的小新
没有蜡笔的小新 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:29

    Well, here is one long-winded way to implement a rectangular 'drop-shadow' without using a bitmap effect. In this case the centre of the 'shadow rectangle' is coloured in, but it could be set to transparent to give you a 'halo' style drop shadow (i.e., equal all the way round - not offset)

    
        
            5
            #60000000
            #00000000
        
        
            
                
                
                
               
            
                
                
                
            
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                        
                        
                    
                
            
    
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                        
                        
                    
                
            
    
            
                
                    
                
            
        
    
    

提交回复
热议问题