Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
Hello Shin-ta, > //data Init > DisplayImpl[] dpys = new DisplayImpl[2]; > dpys[0] = new DisplayImplJ3D("display1"); // 3D window > dpys[1] = new DisplayImplJ2D("display2"); // 2D window > > I want to get the images from these two windows and encoding these two > inmage into GIF file. > > BufferedImage image0= dpysloc[0].getImage(); > BufferedImage image1= dpysloc[1].getImage(); > > but I find out the image types are different. > > image0= dpys[0].getImage(); > //TYPE_USHORT_565_RGB > image1= dpy[1].getImage(); > //TYPE_INT_RGB > > 2D image is sucessful in tranfer into Gif file, 3D image is not. > > Can I get the same image type from 2D&3D windwos or change image type later? This is a mystery. VisAD actually extracts the BufferedImage from Java3D in visad.java3d.VisADCanvasJ3D.postSwap(), where the BufferedImage is constructed with TYPE_INT_RGB. As a test, I put a: System.out.println(image.getType()); inside the while(true) loop in Test51.java (the Java3D getImage() test) and got '1', which represents TYPE_INT_RGB. [I did the same thing in Test50.java (the Java2D getImage() test) and got '4', which represents TYPE_INT_BGR.] So I don't know where your TYPE_USHORT_565_RGB is coming from. However, Don Murray has been writing applications that save Java3D displays to JPEG files, so perhaps he can give you some advice. Cheers, Bill ---------------------------------------------------------- Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706 hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738 http://www.ssec.wisc.edu/~billh/vis.html
visad
archives: