-
beginner's question
Hello, i am a biginner, am just starting OpenGL. i saw examples of the 2-d and 3-d pictures using OpenGL. I would appreciate if someone let know whether it is possible to save such pictures, that are seen on the screen, into the graphical files (eps, png, jpeg etc.)? thanks.
-
Advanced Member
Frequent Contributor
Re: beginner's question
You can write your own snapshot code, or you can use an external snapshot program. What you choose to do is up to you.
-
Re: beginner's question
Hi, does anybody know how to write the snapshot code from within c++, that is what kind of libraries should one should use, or may be there are other ways of writing snapshot codes ? i would appreciate if you let know, may be, the references and the web-sites. thanks.
-
Super Moderator
OpenGL Lord
Re: beginner's question
Use glReadPixels to get the rendered data, then any image I/O library to write this as a file.
This one can do many formats : http://freeimage.sourceforge.net/
If you are fine with only one format, you can directly use libs such as libpng, libjpeg, etc.
-
Re: beginner's question
freeimage looks interesting and promising.
Does anybody know how to save rendered data in EPS format ? what kind of libraries one has to use ? or may be to write eps-file by your own ? thanks.
-
Super Moderator
OpenGL Lord
Re: beginner's question
GraphicsMagick can read/write any file format.
-
Advanced Member
Frequent Contributor
Re: beginner's question
This is easiest and the best, there's also a stb_image_write.h file on the same site:
http://nothings.org/stb_image.c
I always use a screen capture program btw. If you are a noob and don't have much to show anyhow, why bother with the additional workload of writing snapshot code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules