//
//  UIImage+Utility.m
//  Minfo
//
//  Created by Nguyen Hieu on 1/9/13.
//  Copyright (c) 2013 Nguyen Hieu. All rights reserved.
//

#import "UIImage+Utility.h"

@implementation UIImage (Utility)


-(CGSize )ScareImageWithSize:(CGSize )size
{
    float x = self.size.width;
    float y = self.size.height;
    
    float scare_x = size.width/x;
    float scare_y = size.width/y;
    float w = 0;
    float h = 0;
    if(scare_x<scare_y)
    {
        w = x*scare_x;
        h = y*scare_x;
    }
    else{
        w = x*scare_y;
        h = y*scare_y;
    }
    return CGSizeMake(w, h);
}

@end
