我用image读取了一张PNG的图片,然后显示出啦,发现和原图相比,图片黑了很多。
不知道如何解决
请大拿帮忙


请将原图和代码一起发上来。
Image* pngImage = new Image;
pngImage->initWithImageFile(“main_ui_a0.png”);
Texture2D *texture = new Texture2D();
texture->initWithImage(pngImage);
Sprite* s = Sprite::createWithTexture(texture);
s->setPosition(visibleSize/2);
this->addChild(s);
左边直接打开,右边程序打开。。。没啥感觉。。。
显示在界面上的时候 看不太出来 但是我用GPU工具查看texture的时候 发现纹理的颜色是暗的
找到原因了,image里有一个透明通道的属性,开启以后就正常了