Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi, dear developer I need to create simple screenshoter using jogl, now I try to use jogl api, can any show me work screenshoter example?
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Hi
Use the class com.jogamp.opengl.util.awt.Screenshot: http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/util/awt/Screenshot.html
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks, I use this class but I have an error :
Exception in thread "main" javax.media.opengl.GLException: No OpenGL context current on this thread at javax.media.opengl.glu.gl2.GLUgl2.getCurrentGL2(GLUgl2.java:195) at com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(Screenshot.java:259) at webdesktops.server.capture.ScreenCapture.main(ScreenCapture.java:82) I read at forum that Its actually very simple to get a screenshot of ur JOGL renderings. Here's a small snippet that could be used inside (at the end) of the display() method of ur GLEventListener: BufferedImage tScreenshot = Screenshot.readToBufferedImage(0,0, tScreenWidth, tScreenHeight, false); File tScreenCaptureImageFile = new File(tFileName); ImageIO.write(tScreenshot, "png", tScreenCaptureImageFile); ... or u can press the whole process in a single line |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Yes you must call readToBufferedImage only when the OpenGL context is current, for example in GLEventListener.display(), you cannot call it directly in your main method, you have to create a canvas, set a GLEventListener to it, use an animator and it will work fine.
Edit.: Maybe use an offscreen canvas.
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
On 09/11/2012 04:31 PM, gouessej [via jogamp] wrote:
> Yes you must call readToBufferedImage only when the OpenGL context is current, > for example in GLEventListener.display(), you cannot call it directly in your > main method, you have to create a canvas, set a GLEventListener to it, use an > animator and it will work fine. I recommend using GLReadBufferUtil as demonstrated in UITest's snapshot(..): gl.glFinish(); // just make sure rendering finished .. if(readBufferUtil.readPixels(gl, false)) { readBufferUtil.write(new File("snap.png")); } It benefits of being toolkit independent and works well w/ ES1, ES2 and desktop GL profiles. UITest is our JUnit test super-class. ~Sven |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by gouessej
Oh my Gawd. I never knew this type of class existed. I thought the only class available was the Robot class.
Is this class fast? Can this class take 60 screen shots per second? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Robot class is slow, I test perfomence of this class, that's why I need a quick 24-32 fps screen method.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by Sven Gothel
Sven if it isn't difficult can you please describe me hot I can do it from this Util,it's would be great. My task is to create desktop capture, that's why I need to create 24-32 fps screen grabber of desktop, can I do it by jogl???Sorry for bad English.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
@Andriy we are almost trying to do the same thing.
Does anybody know if "Is this class fast? Can this class take 60 screen shots per second?". |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
It can do 10-20 screens per second, I try to test it and create video by java media framework, but it wasn't succ, may be I have mistake in test, but I download 3-d part java screen recorder base on jmf and robot class and try to capture real video, result was not well. Anybody know another method to get screen using java 24-30 screens per second???
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
"It can do 10-20 screens per second" Are you telling me that you can reach 10-20 frames per second with this http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/util/awt/Screenshot.html?
By the way, this is what I'm going to use for this task http://code.google.com/p/javacv/. However I was expecting an easier solution from this thread. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Pixelapp, may be I tell you wrong, my English isn't not well, I tell you about Robot class, it is slow, about JavaCV I don't know I didn't test it. May be you tell me solution for this problem, it's would be great and I'll be great thanks for you.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Oh ok. I know all about the robot class already.
I guess I'll have to test http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/util/awt/Screenshot.html. Unless someone is kind enough to tell me the speed of this class. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by Andriy
"May be you tell me solution for this problem, it's would be great and I'll be great thanks for you." I'm trying also to find the solution.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by Pixelapp
I want also to test this class, but I am new in jongl I can't enougth to create simple example to get desktop screenshot by this lib, if I do it I also to research it lib. That's why I need help from people who work with this lib and know it. I need simple example of desktop screenshot by this lib. May be I want a many from this lib, now if I undestand it help to create futures for 3-d,2-d graffic.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I'll test it out as soon as I have time.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Please if it isn't difficult send me your desktop screen grabber code????Or describe how to get desktop screenshot by jogl.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I'll just post it in this thread.
Just make sure to remind me later on. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Ok, write the best time to contact to you.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Write to this thread in about a week or less, it will show up on my desktop screen.
![]() |
Free forum by Nabble | Edit this page |