Printing in OpenGL on CMYK printer

We have a simple drawing that uses MFC and OpenGL on WindowsNT 4.0. We specify colors in RGB mode but are trying to print on a CMYK printer that messes up the colors. To be precise Red and Blue are totally messed up while printing. We have tried to print some other drawing from some other draing package such as Paint and PowerPpoint, they give good results. What could be the problem ?

How are you trying to do your printing? Windows abstracts away much of the details about the type of printer you are using (though you can ask about certain things), so I’m not sure how you can get odd colors. Have you gotten printing to work well in other, non-OpenGL applications that you have written?

For printing, I would suggest rendering the scene specifically for the resolution of your printer and sending that bitmap to the printer.

Thanks for your reply.

We achieve printing through metafiles. Therefore, the code for rendering on screen and printer is exactly same. As suggested by you, we tried the bitmap option but fialed to get impressive results eveny on a normal printer with which out current printing mechanism(using metafiles) works fine.

Our metafile based printing works fine on a HP printer but fails on an EPSON Stylus 680 printer which the EPSON claims to be a CMYK printer.

I also have big problems with metafiles. I seem to be able to create the metafile with a valid looking header but when I try to Play the metafile I get an incorrect pixel format error message returned.

I believe the OpenGL data is stored as records within the metafile. Two sorts of records are defined EMRGLSBOUNDRECORD and EMRGLSRECORD. You can find the definitions in the MSDN library. The OpenGL data representing the functions is stored in data blocks attached, but the documentation does not explain how it is stored. A simple 2 line rendering creates a metafile with 440 records. I have not yet enumerated through the records to see what they contain.

I believe that any system processing the Metafile must ba able to process the OpenGL data held in these records. Maybe the different printer drivers can this data differently and thus some print while others do not. Can you open the metafile with Microsoft Word, Powerpoint or a similar package??

Could you let me know the steps you use to set up the metafile Device Context and OpenGL rendering Context with maybe some sample code and a valid emf file??