1
我试图生成QImage
和QOpenGLTexture
纹理。 我已经设置了QImage
颜色格式RGBA8888
,并设置颜色与setPixel
,但似乎不管我怎么改变alpha值,它仍然是255,画面的透明度,永远不会改变。如何QOpenGLTexture创建一个带alpha纹理?
这里是我的代码:
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函数的设置问题。 –