UIScrollView 내에서 확대/축소하면 UIImageView 프레임 만 변경되지만 이미지 속성의 UIImage는 변경되지 않습니다.
UIImageView * ImageViewOnScroll;
//set image and zoom it
...
UIImageView * newImageView = [[UIImageView alloc] initWithImage:ImageViewOnScroll.image];
newImageView.frame = ImageViewOnScroll.frame;
: 당신은 단지 다른 UIImageView에 조정이 이미지를 표시 할 경우
, 당신은 같은 이미지를 바로있는 UIScrollView에서 확대있는 UIImageView의 프레임과 같은 새의 UIImageView 프레임을 설정있는 UIImage의 크기를 변경하고 사용하지 말아야합니다
경우 당신은 다음과 같은 간단한 방법으로, 예를 들어 그것을 할 수 변경된 크기의 새로운있는 UIImage를 만들려면 몇 가지 이유 :
UIImage * resizeImage(UIImage * img, CGSize newSize){
UIGraphicsBeginImageContext(newSize);
//or other CGInterpolationQuality value
CGContextSetInterpolationQuality(UIGraphicsGetCurrentContext(), kCGInterpolationDefault);
[img drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
는 "이미지를 얻을"무엇을 의미합니까? 그 크기에 따라 또 다른 UIImage를 만들고 싶다는 뜻입니까? 또는 이미지 파일을 원하십니까? –
크기가 조정 된 이미지로 UIImage를 만들고 싶습니다. – lostInTransit
PPS - 세로 이미지 용으로 작동합니다. 풍경 이미지에만 문제가 있습니다. – lostInTransit