사진을 찍을때 해상도가 커서 용량을 줄일때가 필요하다.
그럴때 이걸 쓰면 금방이다.
레퍼토리는 간단하다 사진 찍을껄 UIImage에 넣었다면 또하나에 UIImage를 사이즈를 줄이고 거기다 넣는 방식이다.
아래 소스를 참고 해주세요.
UIImage *tempImage = nil; CGSize targetSize = CGSizeMake(imgCapture.size.width/5, imgCapture.size.height/5); UIGraphicsBeginImageContext(targetSize); CGRect thumbnailRect = CGRectMake(0, 0, 0, 0); thumbnailRect.origin = CGPointMake(0.0,0.0); thumbnailRect.size.width = targetSize.width; thumbnailRect.size.height = targetSize.height; [imgCapture drawInRect:thumbnailRect]; tempImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
'(IT)Program > IOS ' 카테고리의 다른 글
ios xcode in app purchase example (0) | 2017.02.08 |
---|---|
Objective-C UIWebView URL Load (0) | 2016.11.30 |
Objective c Beacon Exam(IOS) 관련 함수 (0) | 2016.11.27 |
UITabBar Image Selected 이미지가 보이지 않는현상 (0) | 2016.11.24 |
IOS 10 / Xcode 8 업데이트 이후 사진 접근 (0) | 2016.11.23 |