拉伸和缩放图像之间的区别
谁能告诉我拉伸和缩放图像之间的确切区别是什么?因为您无论如何都可以设置 image 和 imageView 的大小来满足您的要求。
Can anybody please tell me what is the exact difference between stretching and scaling an image? Because you can anyway set the size of image and imageView both to match your requirements.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这取决于您如何定义拉伸,但我会根据是否保留纵横比将缩放分为两个不同的选项。缩放图像时通常希望保留纵横比。
我认为一个维度的增加,但另一个维度的增加不成比例,是一种“拉伸”。类似地,一个维度减少但另一个维度不成比例减少将是“挤压”。
您可能会发现这篇大胆的火球帖子很有趣。
It depends on how you define stretching, but I would divide scaling into two distinct options based on whether or not the aspect ratio is preserved. Often it is desired to preserve the aspect ratio when scaling an image.
I would consider an increase in one dimension, but not proportionally in the other to be a "stretch". Similarly, a decrease in one dimension, but not proportionally in the other would be a "squash".
You may find this Daring Fireball post interesting.
拉伸听起来就像以 (100x100) 或 (100x10) 显示小尺寸 (10x10) 图像。所以有时它会变得像素化。
缩放意味着将图像显示为不同的大小,无论是小还是大,同时保持其纵横比(以编程方式),因此它看起来不会不合适,因为当您拉伸到不同的纵横比时,图像中的某些对象会获得不正确的可见性。
Stretching sounds like showing small size (10x10) image at (100x100) or (100x10). so some times it gets pix-elated.
And scaling means to show a image to different size either small or big with maintaining its aspect ratio (programmetically), so it will look not improper, because when you stretch to different aspect ratio then some objects in image gets improper visibility.
拉伸(在 iPhone IB 中)意味着“9 切片缩放”,缩放意味着只是缩放。
拉伸时,您可以确定图像的哪些部分可以用于拉伸,哪些部分不能。例如,当您有一个圆角正方形时,您不希望圆角拉伸,尤其是当您仅水平或垂直拉伸时。
您表明您只想使用中间像素通过(在 IB 中)设置 X 和 来拉伸。 Y 值设置为 0.50(一半),宽度和宽度设置为 0.50。高度值为 0.00(最小像素量)
在文档中查找
contentStretch
以获取更多信息Stretching (in iphone IB) means '9-slice scaling', scaling means just scaling.
When stretching you can determine which part of the image may be used for stretching and which part may not. For example when you have a rounded square, you do not want the roundings to stretch, especially when you're only stretching horizontally or vertically.
You indicate that you only want to use the middle pixel to stretch by (in IB) setting the X & Y values to 0.50 (half way) and the width & height values to 0.00 (minimum amount of pixels)
Lookup
contentStretch
in the docs for more info当您不保持图像的一致性时,您会看到图像不协调并且图像的高度和宽度不适合显示。为了解决这个问题,您可以将图像的宽度和高度乘以一个常数系数。
when you don,t keep the congruence of your image, you see the image incongruous and height and width of your image is not suitable for showing. for resolving this issue you can multiply your image's width and height to to a constant coefficient.
拉伸和缩放并不意味着任何不同,除了内涵之外。
您是否想理解某处特定的文字?也许我们可以提供帮助。
Stretching and scaling don't mean anything different except maybe in connotation.
Is there a particular piece of text somewhere that you are trying to understand? Maybe we can help with that.
拉伸图像是拉伸小图像的尺寸。
另一方面,图像缩放是根据视口的宽度和视口的高度来缩放图像......
缩放可以通过小图像和大图像来完成。
你应该拍摄一张高质量的图像,然后缩放它
stretching image is stretching the size of a small image.
on the other hand scaling of image is scaling the image accoring the the viewport's width and viewport's height....
scaling can be done by small as well as large image.
you should take a good quality image and then should scale it