//scale to fit view, not so good! float _width = imgSize.width; float _height = imgSize.height; if ( (imgSize.width > _frame.size.width) || (imgSize.height > _frame.size.height) ) { float _amount = 0.0f; if (_width > _frame.size.width) { _amount = _frame.size.width / _width; _width *= _amount; _height *= _amount; } if (_height > _frame.size.height) { _amount = _frame.size.height / _width; _width *= _amount; _height *= _amount; } } [imgView setFrame:CGRectMake((_frame.size.width-_width)/2, (_frame.size.height-_height)/2, _width, _height)];