title: Resize CGImageRef without anti-liasing
body: <p>I am trying to resize a 10x10 pixel CGImageRef, captured like this:</p>
  
  <pre><code>CGImageRef imageRef = CGImageCreateWithImageInRect(screenShot, CGRectMake(mouseLoc.x-5, screen_height-mouseLoc.y-5, 10, 10));
  
  CGContextRef mainViewContentContext = CGBitmapContextCreate (NULL, maskImage.size.width, maskImage.size.height, 8, maskImage.size.height*4, colorSpace, kCGImageAlphaPremultipliedFirst);
  
  CGContextDrawImage(mainViewContentContext, NSMakeRect(0,0, maskImage.size.width, maskImage.size.height), imageRef);
  </code></pre>
  
  <p>Then I need to make a 250x250 pixel image like this <a href="http://i.stack.imgur.com/nlLJ2.png" rel="nofollow">this</a>, but the upscaled image looks like there is anti aliasing on it (looks like <a href="http://i.stack.imgur.com/aG2Wg.png" rel="nofollow">this</a>)</p>