5

次のようにキャプチャされた10x10ピクセルのCGImageRefのサイズを変更しようとしています。

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);

次に、このような250x250ピクセルの画像を作成する必要がありますが、アップスケールされた画像にはアンチエイリアシングがあるように見えます(このように見えます)

4

1 に答える 1

6

試してみてくださいCGContextSetInterpolationQuality

// disable interpolation like this:
CGContextSetInterpolationQuality(mainViewContentContext, kCGInterpolationNone);
// now draw
于 2011-08-29T17:07:44.023 に答える