JAI and Translating image

Discussion in 'Java' started by Grzegorz Wrazen, Jul 15, 2004.

  1. Hi,

    I have some problem connected with translating
    BufferedImage by JAI lib. Below is my code:

    ParameterBlock pb = new ParameterBlock();
    pb.addSource(image); <--my BufferedImage
    pb.add(8f);
    pb.add(0f);
    pb.add(new InterpolationNearest()); // The interpolation

    // Create the translate operation
    RenderedOp op = JAI.create("translate", pb, null);
    image = op.getAsBufferedImage();

    // Below I would like to change images.
    imageScrollPane.getViewport().remove(imagePanel);
    imagePanel = new ImagePanel(image);
    imageScrollPane.getViewport().add(imagePanel);
    imageScrollPane.getViewport().repaint();

    ImagePanel inherited from JPanel.
    ----------------------------------------------------
    It do nothing, the image is the same like earlier.
    What is wrong ?

    Regards gWW
     
    Grzegorz Wrazen, Jul 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chuck Taylor
    Replies:
    1
    Views:
    8,299
    Chuck Taylor
    Sep 4, 2003
  2. cyril
    Replies:
    1
    Views:
    796
    cyril
    Sep 8, 2003
  3. Replies:
    0
    Views:
    1,510
  4. Olivier
    Replies:
    2
    Views:
    3,750
  5. Andre Raue
    Replies:
    0
    Views:
    540
    Andre Raue
    Oct 18, 2004
Loading...

Share This Page