Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Default Need help with mirror images for dr.java

    I'm trying to flip the image from the right to the left over the vertical midpoint. I know how to flip the image from left to right, but not the other way around.
    Here is my code so far

    public void mirrorVertical()
    {
    int width = this.getWidth();
    int mirrorPoint = width / 2;
    Pixel leftPixel = null;
    Pixel rightPixel = null;

    for (int y = 0; y < getHeight(); y++)
    {
    for (int x = 0; x < mirrorPoint; x++)
    {
    leftPixel = getPixel (x,y);
    rightPixel = getPixel (width -1 - x, y);
    rightPixel.setColor(leftPixel.getColor());
    }
    }
    }

  2. #2
    newb_tewb is offline Member
    Join Date
    Apr 2010
    Posts
    5
    Rep Power
    0

Similar Threads

  1. Extract images from Java applet
    By User01 in forum Java Applets
    Replies: 2
    Last Post: 12-23-2009, 06:44 AM
  2. capture webcam images with java
    By MuslimCoder in forum Advanced Java
    Replies: 3
    Last Post: 12-21-2009, 03:21 PM
  3. Replies: 7
    Last Post: 07-22-2008, 05:54 PM
  4. Help using images in Java
    By toby in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •