我是WPF的新手。
我有下面的xaml -
<c:MyControl Fill="Red" Height="300" Width="150">
<c:MyControl.RenderTransform>
<ScaleTransform ScaleX="0.5" ScaleY="0.5"></ScaleTransform>
</c:MyControl.RenderTransform>
</c:MyControl>这段代码运行良好,但经过转换后,它占用了整个300*150空间。我想要它占用150*75个空间,因为我转换了它的50%。我该怎么做呢?我应该使用哪种转换模式?
发布于 2013-05-29 15:04:47
使用LayoutTransform而不是RenderTransform。
<c:MyControl Fill="Red" Height="300" Width="150">
<c:MyControl.LayoutTransform>
<ScaleTransform ScaleX="0.5" ScaleY="0.5"/>
</c:MyControl.LayoutTransform>
</c:MyControl>https://stackoverflow.com/questions/16807404
复制相似问题