WPF Stretch None,Fill,Uniform,UnformToFill

None, The content preserves its original size.

<Image Source="/WpfApp169;component/cl.jpg" Stretch="None"/>

 Fill,The content is resized to fill the destination dimensions. The aspect ratio is not preserved.

<Image Source="/WpfApp169;component/cl.jpg" Stretch="Fill"/>

 

 

Uniform,The content is resized to fit in the destination dimensions while it preserves  its native aspect ratio

<Image Source="/WpfApp169;component/cl.jpg" Stretch="Uniform"/>

 

 

 

UniformToFill, The content is resized to fill the destination dimensions while it preserves  its native aspect ratio. If the aspect ratio of the destination rectangle differs  from the source, the source content is clipped to fit in the destination dimensions.

<Image Source="/WpfApp169;component/cl.jpg" Stretch="UniformToFill"/>

 

posted @ 2024-06-15 19:59  FredGrit  阅读(1)  评论(0编辑  收藏  举报