WPF Clipping Problem

前端 未结 2 1874
失恋的感觉
失恋的感觉 2020-12-12 04:38

I have a UserControl which has a quadratic Image as a Child. This Image is at the bottom of the UserControl, and half of it is clipped (e.g. the Control\'s Height is 400, Im

相关标签:
2条回答
  • 2020-12-12 05:15

    How are you rotating the image? If you are rotating using a RenderTransform, then WPF does not re-render what was already displayed on the screen - it simply rotates the pixels.

    Instead, rotate the image using a LayoutTransform; this forces WPF to re-render the control given the new area it occupies, which should eliminate the clipping you see.

    0 讨论(0)
  • 2020-12-12 05:22

    You can also call InvalidateMeasure() after applying render transform.

    0 讨论(0)
提交回复
热议问题