Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generateSmallThumb (imagePath) {
- var image = [UIImage imageNamed:imagePath];
- rect = {0:{0:0,1:124},1:{0:0,1:124}};
- UIGraphicsBeginImageContextWithOptions({width:124, height:124}, NO, 1);
- [image drawInRect:rect];
- var resizedImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- [UIImagePNGRepresentation(resizedImage) writeToFile:imagePath.replace("@3x","@2x") atomically:YES];
- }
Advertisement
Add Comment
Please, Sign In to add comment