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.load("image.png", "PNG");
imm=QImage(53,48,QImage::Format_ARGB32_Premultiplied);
immGL=QImage(53,48,QImage::Format_ARGB32_Premultiplied);
imm.load("image.png", "PNG");
immGL = QGLWidget::convertToGLFormat(imm);
To copy to clipboard, switch view to plain text mode
This is the code to draw the image:
glRasterPos2i(x0,y0);
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, immGL.bits());
glRasterPos2i(x0,y0);
glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, immGL.bits());
To copy to clipboard, switch view to plain text mode
As a result, the image is drawn with all pixel that should be transparent converted to black.
Any solutions?
Thanks in advance,
Rebe
Bookmarks