Reputation: 1061
When I grab a snapshot of a CCLayer as an UIImage with the help of CCRenderTexture it seems like I'm loosing the anti-aliasing, resulting in the output image looking slightly different from what the screen actually looks like.
Is there a way of getting an output image that corresponds more exactly to what is shown on the screen?
This is how I'm getting my UIImage:
-(UIImage*)layerRepresentation {
CCLayer *layer1 = self;
CCRenderTexture *renderer01 = [CCRenderTexture renderTextureWithWidth:layer1.contentSize.width height:layer1.contentSize.height];
[renderer01 begin];
[self visit];
[renderer01 end];
UIImage *image = [renderer01 getUIImage];
return image;
}
Upvotes: 1
Views: 467
Reputation: 7850
When CCRenderTexture is created, it sendssetAliasTexParameters
message to its texture. Try
[renderer01.sprite.texture setAntiAliasTexParameters];
Upvotes: 1