Skip to main content

Screen Capture

4 replies [Last post]
Rrizk
Offline
Joined: 2006-02-17

Hello. I am trying to capture my canvas3d as an image. My problem is that my capture attempt fails if the frame containing the canvas is minimized. Is there any way of taking a snapshot of the canvas while it is minimized?

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mikofclassx
Offline
Joined: 2003-07-02

Nice topic. You'll need to go offscreen. Then you'll face some problems (ie delayed scene updates, alpha channel, speed, incompatibilities, etc). well, it's a start anyway.

Try to use my OffScreenCanvas3D class http://www.javadesktop.org/forums/thread.jspa?threadID=4811&tstart=0

Cheers,

Mik
--

Rrizk
Offline
Joined: 2006-02-17

Hey Mik. Thanks for your help. What you suggested doesn't work for me. Actually, what you suggested is what I am doing. Let me try to put the question some other way. Is it possible to generate an image from anything other than the Canvas3d? I generate an image when I load a 3d model into my canvas, if the canvas is minimized when the application starts, the image is blank. I want the image to be generated nonetheless. Thanks again.

mikofclassx
Offline
Joined: 2003-07-02

Well, I had exactly the same problem and the code above works for me. Infact I do not even open a single jframe in order to take pic of the scene.

AFAIK I don't think you can take pictures of your 3d scene with Java3D in any other way than using a Canvas3D.

Cheers,

Mik
--

Rrizk
Offline
Joined: 2006-02-17

Thanks a lot Mik. I was already using the exact same code, but my problem was that I was basing my snapshopt dimensions on the onscreen size. Meaning, if the frame containing the canvas was minimized, the offscreen renderer would have wrong dimensions to work with.

Anyway, thanks for your help.