locked
Scaling a Path Shape in Windows Store App RRS feed

  • Question

  • I'm porting my wpf application to a windows store app. I‘m drawing a path on a Canvas and as the user zooms in on the Canvas, the path's StrokeThickness is reduced accordingly to keep the same visual thickness. This works well in my wpf application and also in a Windows Phone 8 App but when I do this in my Store App, the line pixelates as shown on this picture:

    http://s21.postimg.org/6g0u6fd7r/Path_Scaling.png

    Zoom Level 1

    <Grid Background="Black">
        <Canvas>
            <Canvas.RenderTransform>
                <ScaleTransform ScaleX="1" ScaleY="1"/>
            </Canvas.RenderTransform>
            <Path Stroke="Red" Data="M0,0 L100,100" StrokeThickness="40"/>
        </Canvas>
    </Grid>   

    Zoom Level 500

    <Grid Background="Black">
        <Canvas>
            <Canvas.RenderTransform>
                <ScaleTransform ScaleX="500" ScaleY="500"/>
            </Canvas.RenderTransform>
            <Path Stroke="Red" Data="M0,0 L100,100" StrokeThickness="0.08"/>
        </Canvas>
    </Grid>   

    Can someone please point out what I'm doing wrong here?

    Thursday, August 22, 2013 3:09 PM

All replies

  • Hi,Thor

    When I create a project to test the problem ,I found the path's StrokeThickness keep the same

    visual thickness according to the same ScaleX and ScaleY property in ScaleTransform.The

    project worked well.

    I suggest you can upload your project to SKyDrive and share a link in the forum!

    Best Wishes!


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    • Edited by Anne Jing Friday, August 23, 2013 5:41 AM from
    Friday, August 23, 2013 5:40 AM