- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
I have a problem, and I am in desperate need of help. I have written a program in a windows-project, and I have used opengl to plot some graphs. Now, I would like to add the option to print the contents of the opengl-window to a printer. But I can't get it to work. No matter what I do, the page prints out blank.
Has anyone else had this problem, and has someone any idea how to do?
Thank you for any help.
Jenny
I have a problem, and I am in desperate need of help. I have written a program in a windows-project, and I have used opengl to plot some graphs. Now, I would like to add the option to print the contents of the opengl-window to a printer. But I can't get it to work. No matter what I do, the page prints out blank.
Has anyone else had this problem, and has someone any idea how to do?
Thank you for any help.
Jenny
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Most printer device contexts don't support OpenGL. You'll need to create a bitmap, render your OpenGL graph to the bitmap, and then print the bitmap.
Alternatively, you can look into creating an enhanced metafile with embedded OpenGL calls and then print the metafile, but I believe this doesn't work under Win98/Me. There's an article on this at: http://www.starstonesoftware.com/OpenGL/metafile.htm.
The non-programattic solution is to just do an Alt-Print Screen and then paste from the clipboard to MS Paint and print from there. But that is not very satisfactory if you are creating a commerical product.
Hope this helps!
John
Alternatively, you can look into creating an enhanced metafile with embedded OpenGL calls and then print the metafile, but I believe this doesn't work under Win98/Me. There's an article on this at: http://www.starstonesoftware.com/OpenGL/metafile.htm.
The non-programattic solution is to just do an Alt-Print Screen and then paste from the clipboard to MS Paint and print from there. But that is not very satisfactory if you are creating a commerical product.
Hope this helps!
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your answer! I work with windows 2000, does the metafile approach work then? I have already tried this, I made a enhanced metafile from the window handle, but I never managed to send it to the printer correctly.
I will try writing to a bitmap. I will be back to let you know how it went.
/ Jenny
I will try writing to a bitmap. I will be back to let you know how it went.
/ Jenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tried translating Steve's metafile approach to Fortran, but printing using his sample C++ application worked on my Windows 2000 system.
Let us know how the bitmap printing works out.
John
Let us know how the bitmap printing works out.
John

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page