내 iPad 앱에는 여러 페이지의 스크린 샷을 표시하는 탐색 지점이 있으며 두 개 이상의 스크린 샷을 한 번에 표시하고 싶기 때문에 컨테이너를 원본 스크린 샷의 약 24 % (1024x768). 나는 "작은"텍스트와 이미지를 확장 할 때UIView가 포함되어있을 때 UIImage/UIImageView 다시 그리기
- (void) loadView
{
// get landscape screen frame
CGRect screenFrame = [UIScreen mainScreen].bounds;
CGRect landscapeFrame = CGRectMake(0, 0, screenFrame.size.height, screenFrame.size.width);
UIView *view = [[UIView alloc] initWithFrame:landscapeFrame];
view.backgroundColor = [UIColor grayColor];
self.view = view;
// add container view for 2 images
CGRect startFrame = CGRectMake(-landscapeFrame.size.width/2, 0, landscapeFrame.size.width*2, landscapeFrame.size.height);
container = [[UIView alloc] initWithFrame:startFrame];
container.backgroundColor = [UIColor whiteColor];
// add image 1 (1024x768)
UIImage *img1 = [UIImage imageNamed:@"01.jpeg"];
UIImageView *img1View = [[UIImageView alloc] initWithImage:img1];
[container addSubview:img1View];
// add image 2 (1024x768)
UIImage *img2 = [UIImage imageNamed:@"02.jpeg"];
UIImageView *img2View = [[UIImageView alloc] initWithImage:img2];
// move img2 to the right of img1
CGRect newFrame = img2View.frame;
newFrame.origin.x = 1024.0;
img2View.frame = newFrame;
[container addSubview:img2View];
// scale to 24%
container.transform = CGAffineTransformMakeScale(0.24, 0.24);
[self.view addSubview:container];
}
는하지만이 같은 STH 보이는 :
나는 사용자가 이미지를 도청 경우가 확장해야하기 때문에 큰 스크린 샷을 사용해야합니다 100 % 신선하고 깨끗합니다.
내가 성능을 망치지 않고 "부드럽게"이미지를 스케일 할 수있는 방법은 무엇입니까? 두 가지 버전, 즉 full-px 버전과 24 % 버전의 버전이 충분합니다.
내가 코드를 조금 단순화은. 스크린 샷은 (종류의) 대화 형이어야하므로 모든 스크린 샷에서 큰 이미지를 만들 수는 없습니다. ( – pkyeck