Re: Rendering an offscreen image

I have implemented offscreen rendering in Java2D, and image
capture for both Java2D and Java3D.  See examples/DisplayTest.java
cases 50-52 for examples of how to code these functions.  Note
also that offscreen rendering is currently not possible with
Java3D - but that capability is promised for Java3D version 1.2.
 
The constructor:
 
  DisplayImplJ2D(String name, int width, int height)
 
creates a DisplayImplJ2D for offscreen rendering.  Note that
its getComponent() returns null.
 
The method:
 
  BufferedImage DisplayImpl.getImage()
 
returns a BufferedImage captured from the display, for either
Java2D or Java3D.  You can read pixels from it, and use it to
write image files.
 
Good luck, and please let me know if you have any problems with
these.
 
Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
whibbard@xxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html
 
"kill cross-platform Java by growing the polluted Java market"
   - from an internal Microsoft planning document
 

  • 1998 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: