【IOS】如何做图片缩略图

己扩展的方法 
- (NSImage *)resizeTo:(NSSize)newsize 

    NSRect rect=NSMakeRect(0, 0, newsize.width, newsize.height); 
    NSImage *resizedImage = [[NSImage alloc] initWithSize:rect.size]; 
    [resizedImage lockFocus]; 
    [self drawInRect:rect fromRect:NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; 
    [resizedImage unlockFocus]; 
    return [resizedImage autorelease]; 
}

你可能感兴趣的:(【IOS】如何做图片缩略图)