拉伸和缩放图像之间的区别

发布于 2024-08-21 10:33:29 字数 72 浏览 2 评论 0原文

谁能告诉我拉伸和缩放图像之间的确切区别是什么?因为您无论如何都可以设置 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

遮云壑 2024-08-28 10:33:29

这取决于您如何定义拉伸,但我会根据是否保留纵横比将缩放分为两个不同的选项。缩放图像时通常希望保留纵横比。

我认为一个维度的增加,但另一个维度的增加不成比例,是一种“拉伸”。类似地,一个维度减少但另一个维度不成比例减少将是“挤压”。

您可能会发现这篇大胆的火球帖子很有趣。

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.

凉城凉梦凉人心 2024-08-28 10:33:29

拉伸听起来就像以 (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.

人海汹涌 2024-08-28 10:33:29

拉伸(在 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

櫻之舞 2024-08-28 10:33:29

当您不保持图像的一致性时,您会看到图像不协调并且图像的高度和宽度不适合显示。为了解决这个问题,您可以将图像的宽度和高度乘以一个常数系数。

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.

情栀口红 2024-08-28 10:33:29

拉伸和缩放并不意味着任何不同,除了内涵之外。

您是否想理解某处特定的文字?也许我们可以提供帮助。

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.

不可一世的女人 2024-08-28 10:33:29

拉伸图像是拉伸小图像的尺寸。
另一方面,图像缩放是根据视口的宽度和视口的高度来缩放图像......

缩放可以通过小图像和大图像来完成。

你应该拍摄一张高质量的图像,然后缩放它

sprite.setscale(x,y);

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

sprite.setscale(x,y);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文