Panel
类有如下比较常见的属性:
Background
:用于填充 Panel
的边框之间的区域的 Brush
。
Children
:此 Panel
的子元素的 UIElementCollection
。
Height
:元素的建议高度。
HorizontalAlignment
:在父元素(如面板或项控件)中构成此元素时应用于此元素的水平对齐特征。
MaxHeight
:元素的最大高度约束,MaxHeight
的默认值是PositiveInfinity
(正无穷大)。
MaxWidth
:元素的最大宽度约束,MaxWidth
的默认值是PositiveInfinity
(正无穷大)。
MinHeight
:元素的最小高度约束,MinHeight
的默认值分别是Auto(
自动调整)。
MinWidth
:元素的最小宽度约束,MinWidth
的默认值分别是Auto(
自动调整)。
VerticalAlignment
:在父元素(如面板或项控件)中组合此元素时应用于此元素的垂直对齐特征。
对于Image的特效处理:(其中的centx centery表示图片的中间,也就是长的一半和高的一半)
Image旋转加透明:
对于Image的特效处理:(其中的centx centery表示图片的中间,也就是长的一半和高的一半)
<Image Canvas.Left="100" Canvas.Top="10" Height="100" Name="image4" Stretch="Fill" Width="200" Source="/layoutSample;component/Images/Desktop.jpg">
<Image.RenderTransform>
<RotateTransform Angle="40" CenterX="20" CenterY="50"></RotateTransform>
</Image.RenderTransform>
</Image>
Image旋转加透明:
<Image Canvas.Left="350" Canvas.Top="0" Height="100" Name="image03" Stretch="Fill" Width="100" Source="/layoutSample;component/Images/Desktop.jpg" Opacity="0.8">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-0.75"></ScaleTransform>
<TranslateTransform Y="180" X="30"></TranslateTransform>
<SkewTransform AngleX="-15"></SkewTransform>
</TransformGroup>
</Image.RenderTransform>
<Image.OpacityMask>
<LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
<GradientStop Offset="0.0" Color="#00000000"></GradientStop>
<GradientStop Offset="1.0" Color="#FF000000"></GradientStop>
</LinearGradientBrush>
</Image.OpacityMask>
</Image>