3
프로그래밍 방식 그래서 같이있는 UIImage로 그릴려고 :iOS에서 앤티 앨리어싱/보간없이 비트 맵을 그리는 방법은 무엇입니까?
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIGraphicsBeginImageContextWithOptions(CGSizeMake(2, 2), YES, 1);
CGContextRef context = UIGraphicsGetCurrentContext();
// These three lines of code apparently do nothing.
CGContextSetInterpolationQuality(context, kCGInterpolationNone);
CGContextSetAllowsAntialiasing(context, false);
CGContextSetShouldAntialias(context, false);
CGContextSetFillColorWithColor(context, [UIColor colorWithRed:1 green:0 blue:0 alpha:1].CGColor);
CGContextFillRect(context, CGRectMake(0, 0, 1, 1));
self.imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
이 코드는 결과 이미지가 안티 앨리어싱/보간에서 공격적인 시도에서 분명 매우 부드럽고 것을 제외하고 작동합니다. 가장 가까운 이웃 보간을 사용하여 이미지의 크기를 조정해야합니다. 어떻게이 안티 앨리어싱을 방지합니까?
감사합니다.
는 이미지 뷰의 경계 무엇입니까 ? – murat