一、陰影效果(DropShadowEffect)
<TextBlock Text="陰影效果" FontSize="32" Canvas.Top="50"> <TextBlock.Effect> <DropShadowEffect Color="Black" BlurRadius="10"></DropShadowEffect> </TextBlock.Effect> </TextBlock>
屬性:
Color 陰影的顏色
ShadowDepth 確定陰影離開內容的距離,0的時候是暈圈
Opacity 陰影的透明效果,取值0~1
Direction 陰影相對於內容的方向,取值0~360,0時在右側,數值增加,逆時針轉動
BlurRadius 模糊半徑,以像素為單位的正直,標識模糊開始處到邊緣的距離
二、BlurEffect 模糊效果
<TextBlock Padding="10" Text="設置模糊" FontSize="32" Background="#999"> <TextBlock.Effect> <BlurEffect Radius="5"></BlurEffect> </TextBlock.Effect> </TextBlock>
BitmapEffect位圖效果是簡單的像素處理操作。它可以呈現下面幾種特殊效果。
BevelBitmapEffect 凹凸效果
BlurBitmapEffect 模糊效果
DropShadowBitmapEffect投影效果
EmbossBitmapEffect 浮雕效果
OuterGlowBitmapEffect 顏色光暈效果
