Path Geometry Clipping Equvalent in WinRT

后端 未结 5 443
长情又很酷
长情又很酷 2020-12-05 15:34

Today I started porting the page turn sample created here for Windows Phone 7 to WinRT (XAML, C#) for helping this question posted in Stack Overflow. But during porting I go

5条回答
  •  有刺的猬
    2020-12-05 16:27

    I feel it needs to be said that for the "Path with ImageBrush Fill" technique it is basically impossible to get the image to align exactly as you want using transforms, because the exact position of the image (of the imagebrush) inside the path clip depends on the extents of the path including Stroke.

    So for example if you have a Bezier Path, you would need to calculate the actual extents of that Bezier to be then able to determine the exact scale/translate transform to apply to the image.

    Stroke seems innocent, but when you have sharp angles in your poly-line path, the stroke makes a sharp pointy triangle! But also only to an extent, since after the angle gets really sharp, the triangle is not so pointy anymore! So, you would need to replicate the exact algorithm that does the Stroke for a Path.

    Finally, I do need to admit there is the option to duplicate your Path for the Stroke, so have one with ImageBrush Fill and the other one without but with Stroke.

提交回复
热议问题