views:

381

answers:

5

Hi all!

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.

+1  A: 

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.

Sanniv
+1  A: 

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.

gerry3
A: 

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.

masoud ramezani
A: 

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.

Ken
Nothing in specific. I just wanted to know the basic difference. Thank you all..
neha
A: 

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

Maarten Wolzak