【发布时间】:2016-10-22 01:01:57
【问题描述】:
我正在尝试使用QImage 和QOpenGLTexture 生成纹理。
我已经将QImage颜色格式设置为RGBA8888,并用setPixel设置颜色,但似乎无论我如何更改alpha值,它仍然是255,并且图片的透明度永远不会改变.
这是我的代码:
QImage texPic(width, height, QImage::Format_RGBA8888);
texPic.setPixel(0, 0, qRgba(255,0,0,0));
texPic.setPixel(0, 1, qRgba(0,255,0,100));
QOpenGLTexture *texture = new QOpenGLTexture(texPic);
有什么建议吗?
【问题讨论】:
-
谢谢回复,我已经解决了,好像是gl功能设置的问题。
标签: c++ qt opengl-es-2.0 qtopengl