Results 1 to 2 of 2
- 03-10-2010, 09:26 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 1
- Rep Power
- 0
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());
}
}
}
- 04-07-2010, 10:44 PM #2
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Extract images from Java applet
By User01 in forum Java AppletsReplies: 2Last Post: 12-23-2009, 06:44 AM -
capture webcam images with java
By MuslimCoder in forum Advanced JavaReplies: 3Last Post: 12-21-2009, 03:21 PM -
hello Java World http://www.java-forums.org/images/smilies/smile.gif
By aniljoo in forum IntroductionsReplies: 7Last Post: 07-22-2008, 05:54 PM -
Help using images in Java
By toby in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 05:54 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks