I can't find the topleft point for the offset. Even i use
getLocationOnScreen, see code. This code works only if i have the frame in
the lefttop of the screen see pics. The green should be visible in both
pics. So i guess the offset is still wrong but i don't know how i can find
the rigth offset. Who can help me. Or has it to do with that i have my
canvas in a JPanel?????????????????

 public void postSwap()
 {
  topLeftX  = (int)getLocationOnScreen().getX();
  topLeftY  = (int)getLocationOnScreen().getY();

  if(writeJPEG_)
  {
   System.out.println("Writing JPEG");
   GraphicsContext3D  ctx = getGraphicsContext3D();
// The raster components need all be set!
   Raster ras = new Raster(
    new Point3f(-0.0f,-0.0f,-0.0f),
    Raster.RASTER_COLOR,
    topLeftX, topLeftY,
    super.getWidth(), super.getHeight(),
    new ImageComponent2D(
      ImageComponent.FORMAT_RGB,
//      new BufferedImage(512,512,
new BufferedImage(super.getWidth(),super.getHeight(),
      BufferedImage.TYPE_INT_RGB)),
    null);
   ctx.readRaster(ras);

// Now strip out the image info
   BufferedImage img = ras.getImage().getImage();

----- Original Message -----
From: "aant" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 2:02 PM
Subject: Re: [JAVA3D] screen capture


> I use the code mentioned. But still having problems. I guess it has to du
> with the offset?
> ----- Original Message -----
> From: Justin Couch <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, June 28, 2001 1:32 PM
> Subject: Re: [JAVA3D] screen capture
>
>
> > Oliver Radfelder wrote:
> >
> > > http://www.j3d.org/faq/capturing.html
> >
> > There is a working version of this code already in the Code Repository.
> > It will either take single snapshots or create a bunch of sequential
> > images. Have a look at the class ImageCaputringCanvas3D. That should
> > solve all of the issues that you have and save you having to implement
> > the code.
> >
> > --
> > Justin Couch                         http://www.vlc.com.au/~justin/
> > Freelance Java Consultant                  http://www.yumetech.com/
> > Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
> > -------------------------------------------------------------------
> > "Humanism is dead. Animals think, feel; so do machines now.
> > Neither man nor woman is the measure of all things. Every organism
> > processes data according to its domain, its environment; you, with
> > all your brains, would be useless in a mouse's universe..."
> >                                               - Greg Bear, Slant
> > -------------------------------------------------------------------
> >
> >
>
===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff JAVA3D-INTEREST".  For general help, send email
to
> > [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

<<attachment: FrameLeftTopOfScreen2.jpg>>

<<attachment: FrameInMiddleScreen0.jpg>>

Reply via email to