Home > iPhone, tech > Scaling UIImages without losing orientation

Scaling UIImages without losing orientation

We’ve moved!

Hey everyone, all my tech blog posts are now at my personal blog at http://blog.twoalex.com.  I’ll keep blogging about Mealstrom here, but you should hop on over there to check out the latest and greatest about technology (and food) in general.

Read this entry on blog.twoalex.com

Categories: iPhone, tech Tags:
  1. Bisbo
    November 6th, 2009 at 02:14 | #1

    This is a great little function and I use it all the time! A quick note however, it contains a slight little bug. Depending on the height of the input image, you may end up with a slight 1px white line on top of the image. This is due to rounding and the fix would be a simple floor():

    bounds.size.height = floor(bounds.size.width / ratio);

  2. December 3rd, 2009 at 07:20 | #2

    I have been searching for sites related to this. Glad I found you. Thanks

  3. rach
    March 26th, 2010 at 03:03 | #3

    Hi,

    This is good tutorial. I am looking to do scaling in UIWebView which subview of View.
    I have treid to do using CGAffineTransfomScale function to scale down WebView content but I didn’t get scaled in WebView content but it scaled WebView Frame.
    I am looking to scale down 480×270 window WebView content into 120×90 size.

    Do you have any idea about this?
    Please suggest me.

    Thanks,
    rach

  1. October 12th, 2009 at 23:09 | #1