Skip to content

Instantly share code, notes, and snippets.

View dillan's full-sized avatar

Dillan Laughlin dillan

View GitHub Profile
@christophercotton
christophercotton / UIImage+Resize.m
Created July 16, 2010 17:00
Using http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/ but with additions for iPhone 4 hires scale images. Also includes fix for 24bit non alpha images.
// Returns a copy of the image that has been transformed using the given affine transform and scaled to the new size
// The new image's orientation will be UIImageOrientationUp, regardless of the current image's orientation
// If the new size is not integral, it will be rounded up
- (UIImage *)resizedImage:(CGSize)newSize
transform:(CGAffineTransform)transform
drawTransposed:(BOOL)transpose
interpolationQuality:(CGInterpolationQuality)quality {
// COTTON - adding in scaling for iPhone 4
BOOL shouldScale = NO;