This article is a mirror article of machine translation, please click here to jump to the original article.

View: 20392|Reply: 0

[WPF] The Stretch property of the Image in WPF

[Copy link]
Posted on 3/27/2018 7:18:48 PM | | | |

Sometimes we set the Width and Height of the image in the WPF program, but the width and height of the image are not what we expected, which is actually due to the default Stretch property of the image

The Stretch property of the image is Uniform by default, which means that the image will become larger and smaller evenly, ensuring that the proportions of the image are not out of balance, and often the width and height we set do not match the proportions of the image, so the display effect will be

Not what we expected, the Image's Stretch property can also be set to the following value:

None - The image will be displayed at its original size

Fill - The image will be displayed according to the set Width and Height, and the scale will be out of balance

UniformToFill - The image will be displayed according to the set width and height, but the image will be evenly enlarged and reduced, the proportions will not be out of balance, and the image beyond the display range will be cut





Previous:The NHibernate column "ReservedWord" does not belong to the table ReservedWords
Next:WPF makes the image display a circular avatar
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com