How do I turn off all the image processing to see actual, unmodified pixels when I zoom way in?

Viewed 255

I have an app that needs to zoom far enough into images that I can clearly see the individual pixels on an image. I need to see clear squares of one color, with no anti-aliasing or other of the usually-helpful techniques for making images look good on a display. How do I stifle all this help? Here is code that works, but zooms into 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);
}
1 Answers
Related