DOCERR: Printing an OpenGL Image
ID: Q132866
|
The information in this article applies to:
-
Microsoft Win32 Application Programming Interface (API), included with:
-
Microsoft Windows NT, versions 3.5, 3.51
-
Microsoft Windows 95
SUMMARY
The documentation relating to printing an OpenGL image in the Win32 SDK
versions 3.5, 3.51, and 4.0 is incorrect. The current version of
Microsoft's implementation of OpenGL in Windows NT does not provide
support for printing. More specifically, an application cannot call
wglCreateContext or wglMakeCurrent on a printer device context.
To work around this limitation, draw the OpenGL image into a memory bitmap,
and then print the bitmap.
MORE INFORMATION
Here are the correct steps to print an OpenGL image:
- Create a printer device context.
- Create a memory device context.
- Create a bitmap that can be either a DIB section or a screen
compatible bitmap, and select it into the memory device context.
This bitmap must have four or more bits of color information per pixel.
- Set the pixel format of the memory device context.
- Create a rendering context, passing the wglCreateContext function
the handle to the memory device context, and make that rendering context
a thread's current rendering context.
- Make OpenGL calls, which will draw into that rendering context.
- Disconnect and delete the rendering context.
- Use StretchDIBits, SetDIBitsToDevice, StretchBlt, or BitBlt from the
memory device context to the printer device context.
- Delete the bitmap, the memory device context, and the printer device
context.
Additional query words:
3.50 4.00 Windows
Keywords : kbgraphic kbprint kbdocerr kbNTOS350 kbNTOS351 kbWinOS95
Version : winnt:3.5,3.51
Platform : winnt
Issue type :
|