11-09-2006, 03:44 AM
I have been working with printing an OpenGL object for a couple of weeks now. I am again inside a Qt application using a QGLWidget and QPrinter to print out my OpenGL objects. I have only been able to get the image to print out or save to a file as black and white. Whatever has color prints out as black and whatever is white stays white. There is no gray-scaling or anything happening, either solid black or solid white. I have been able to easliy print when I use 24-bit RGB mode, but this time I am trying to use 8-bit color indexing mode. I am thinking it is in the color indexing because if Qt converts the image from 8-bit to 24-bit before printing, there shouldn't be a real problem with that. But if it expects the colors to be in a color indexed mode, could that cause some problems. To print I am just using QGLWidget::renderPixmap (http://doc.trolltech.com/4.1/qglwidget.html#renderPixmap) to get the OpenGL into a pixmap which I then print to the printer by setting a QPainter object to my printer and call QPainter::drawPixmap (http://doc.trolltech.com/4.1/qpainter.html#drawPixmap-7) which sends the rendered pixmap to the printer or file. But they always come out as black and white in my 8-bit color indexed mode. The printer is a color-printer and I can save the files as PostScript and JPEG. Thanks for all your help and if I can provide anymore information, please let me know what you need to know. Thanks!