Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

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

sprite.setscale(x,y);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top