我必须显示一些带有缩放功能的圆圈,但我需要strokethickness保持不变。我怎样才能做到这一点?感谢。
<Grid x:Name="SelectedPanel"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
RenderTransformOrigin="0.5,0.5" IsHitTestVisible="False">
<Grid.RenderTransform>
<ScaleTransform
ScaleX="{Binding some binding}"
ScaleY="{Binding some binding}"/>
</Grid.RenderTransform>
<Ellipse
Stroke="#09C900"
StrokeThickness="3"
StrokeDashArray="5 2"
StrokeDashOffset="6"
RenderTransformOrigin="0.5,0.5"/>
</Grid>
答案 0 :(得分:1)
好吧,如果将ScaleTransform应用于Ellipse,则StrokeThickness将随元素的其余部分一起增长。 我建议你操纵椭圆的宽度和高度。 像这样......
<Ellipse
Stroke="#09C900"
StrokeThickness="3"
StrokeDashArray="5 2"
StrokeDashOffset="6"
Width="{some binding}"
Height="{some binding}"/>