Reputation: 12283
This is my Path:
<Style x:Key="MyPath" TargetType="{x:Type Path}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="Stroke" Value="Blue" />
<Setter Property="Data" Value="M0,100 L 80,40 160,100 M 40,80 L 40,160 120,160 120,80" />
</Style>
<Path Style="{StaticResource MyPath}">
<Path.RenderTransform>
<ScaleTransform ScaleX="0.3"
ScaleY="0.3" />
</Path.RenderTransform>
</Path>
This scales the image, which is good.
The problem is that the white space around the path (with the size of the original Path size) stays visible after the scaling. Setting the Path's Width and Height does not solve the problem because setting the Height for example causes the image to be cut, but the white space still stays there.
I'm adding an image for clarity:
alt text http://img190.imageshack.us/img190/5923/problemis.png
Any help? Thank you
Upvotes: 3
Views: 4524
Reputation: 8596
Try LayoutTransform instead of RenderTransform.
ScotLogic blog - LayoutTransform vs. RenderTransform
"When a LayoutTransform is applied, neighbouring elements are re-positioned to accommodate the transformed elements, whereas with the RenderTransform they are not."
Upvotes: 5