Rebe
6th May 2011, 10:32
Hi!
I'm new to the forum and quite new to the Qt Programming.
I've a problem with QImage.
I need to draw an image (.png) with transparency.
I've serched and read a lot of thread on this forum, but I did'nt found any solution.
This is the code I used to load the image:
imm=QImage(53,48,QImage::Format_ARGB32_Premultipli ed);
immGL=QImage(53,48,QImage::Format_ARGB32_Premultip lied);
imm.load("image.png", "PNG");
immGL = QGLWidget::convertToGLFormat(imm);
This is the code to draw the image:
glRasterPos2i(x0,y0);
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, immGL.bits());
As a result, the image is drawn with all pixel that should be transparent converted to black.
Any solutions?
Thanks in advance,
Rebe
I'm new to the forum and quite new to the Qt Programming.
I've a problem with QImage.
I need to draw an image (.png) with transparency.
I've serched and read a lot of thread on this forum, but I did'nt found any solution.
This is the code I used to load the image:
imm=QImage(53,48,QImage::Format_ARGB32_Premultipli ed);
immGL=QImage(53,48,QImage::Format_ARGB32_Premultip lied);
imm.load("image.png", "PNG");
immGL = QGLWidget::convertToGLFormat(imm);
This is the code to draw the image:
glRasterPos2i(x0,y0);
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, immGL.bits());
As a result, the image is drawn with all pixel that should be transparent converted to black.
Any solutions?
Thanks in advance,
Rebe