图像调整大小 [英] Image Resizing

查看:80
本文介绍了图像调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将图像显示到网格中. < image ...>元素将具有固定的大小,即32 x32.但是实际图像会有所不同,有些是54 x 18,其他是28 x 56.

I want to display images into a grid.  The <image...> elements will have a fixed size, i.e. 32 x32.  However the actual images will vary, some are 54 x 18, other 28 x 56.

因此,为了保持网格看起来一致,我想确保图像与< image ...>成比例.元素尺寸.我不希望图像拉伸或缩小以适合< image ...>元素.外观和感觉 当显示人员列表(在网格中)并且点按联系人(以显示详细信息)时,该图像与电话上的人脉"应用程序非常相似.

So to keep the grid looking consistent, I want to ensure that the images are proportioned to the <image ...> element dimensions.  I don't want the images stretched or shrunk to fit inside the <image ...> element.  The look and feel is much the same as the People app on the phone when the list of people is displayed (in the grid) and when you tap the contact (to display details) the image is larger.

实现此目标的最佳方法是什么?

What is the best way to achieve this?

谢谢

推荐答案

我不确定我是否理解,但我认为您的意思是希望图像适合元素尺寸,但没有拉伸变形.您可以设置Image属性Stretch ="UniformToFill".
I'm not sure that I understood, but I think you meant that you want the image to fit the element dimensions but without stretch distortion. You can set the Image property Stretch="UniformToFill".


这篇关于图像调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆