2013-04-01 40 views
1

當我在CCRenderTexture的幫助下抓取CCLayer的快照作爲UIImage時,看起來好像我放棄了反鋸齒,導致輸出圖像看起來與屏幕看起來有些不同。CCLayer to UIImage - 反走樣?

有沒有辦法讓輸出圖像更符合屏幕上顯示的內容?

這是我應得我的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; 
} 

回答

1

當創建CCRenderTexture,它發送setAliasTexParameters消息,它的質地。嘗試

[renderer01.sprite.texture setAntiAliasTexParameters]; 
+0

完美,謝謝! – oskare