I have an application that needs to be scaled far enough in the images so that I can clearly see the individual pixels in the image. I need to see clear squares of the same color, without smoothing or other commonly useful methods for a good display image. How can I strangle all this help? Here is code that works, but scales to blurry, adjusted pixels:
- (void)drawRect:(CGRect)rect { CGRect photoRect = CGRectMake(currentTarget.origin.x, currentTarget.origin.y, currentTarget.size.width, currentTarget.size.height); CGContextRef context = UIGraphicsGetCurrentContext() ; CGContextSaveGState(context); CGImageRef subImageRef = CGImageCreateWithImageInRect(sourceImage.CGImage, photoRect); UIImage *subImage = [UIImage imageWithCGImage:subImageRef]; [subImage drawInRect:rect]; CGImageRelease(subImageRef); CGContextRestoreGState(context); CGContextFlush(context); }
ios image antialiasing
Bill cheswick
source share