#278 – 允许Image只能变小或者只能变大(Allow an Image to Get Bigger, But Not Smaller (or Vice Versa))
来源:互联网 发布:单农为什么淘宝没有 编辑:程序博客网 时间:2024/05/29 18:22
通常情况下,当设置Image 控件的Stretch 属性为非None 的时候,显示的图像将允许根据设置的值进行对应的拉伸。
例如,设置Stretch 属性为非Uniform ,图像将保持长宽比进行拉伸。当你改变图像容器的大小的时候,图像将会保持长宽比进行拉伸,以保证完整显示。
如果在拉伸的过程中,你想让图像不要超过,或者不要小于原始大小,那么你可以使用StretchDirection 属性。
设置StretchDirection 属性值为DownOnly 允许图像拉伸的时候小于原始大小,但是不能大于原始大小,即图像最大只能以原始大小显示。
设置StretchDirection 属性值为UpOnly 允许图像拉伸的时候大于原始大小,但不能小于原始大小。即图像最小只能以原始大小显示。
原文地址:https://wpf.2000things.com/2011/04/16/278-allow-an-image-to-get-bigger-but-not-smaller-or-vice-versa/
0 0
- #278 – 允许Image只能变小或者只能变大(Allow an Image to Get Bigger, But Not Smaller (or Vice Versa))
- How to convert XSD to XML or vice versa
- How to Get an Android Device Image?
- R12 - GL / XLA / FAH - How to link GL data to the subledger data or vice versa
- L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.)
- Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multi
- wstring to string and vice versa
- c# - string to byte[] and vice versa
- Drawing to an Image
- uva 12930 Bigger or Smaller
- How to center an image?
- #297 – 为图像或者控件创建镜像(Create a Mirror Image of a Control or Image)
- Enum to String and vice versa in C++
- Convert CGPoint/CGRect/CGSize to NSValue and vice versa
- How can I convert NSDictionary to NSData and vice versa?
- How can I convert NSDictionary to NSData and vice versa?
- NI Vision error : not an image解析
- Where to put the Image in an Image Caption Generator
- Element和Node的区别你造吗?
- MP4-2
- 升级ubuntu中的gcc和g++版本
- 《Linux内核设计与实现》--系统调用
- jsp中使用c:import 传递中文参数乱码
- #278 – 允许Image只能变小或者只能变大(Allow an Image to Get Bigger, But Not Smaller (or Vice Versa))
- c# 使用定时器Timer
- 修改UIAlertAction 的文字颜色
- mysql数据库delete数据时不支持表别名
- Linux题目(二)
- TensorFlow教程06:MNIST的CNN实现——源码和运行结果
- 雅虎团队经验:网站页面性能优化的 34条(二)
- 设计模式 ( 十八 ) 策略模式Strategy(对象行为型)
- 解决:Unable to connect to repository https://dl-ssl.google.com/android/eclipse/site.xml