lee_lee07770
New member
My goal is to mirror a picture diagonally, starting at the pixel (0,0) axis ((the top left hand corner to the bottom right hand corner)). Right now my code mirrors my picture diagonally from the bottom left hand corner to the top right hand corner. I was thinking that once I got it mirroring diagonally, I could then write code to turn the whole picture upside down and it would accomplish the task...but is there a way to just change the code to make it do what I want from the beginning? I want to mirror a picture with the line from the top left corner to the bottom right corner. Here is what I have so far: Also...Yahoo might get rid of the indentation in my code. Please assume indenting is done correctly.
import time
import datetime
def mirrorDiagonal(source):
width = getWidth(source)
height = getHeight(source)
for x in range(width):
for y in range(height):
color = getColor(getPixel(source, y, x))
flipSide = getPixel(source, height-x-1, width-y-1)
setColor(flipSide, color)
import time
import datetime
def mirrorDiagonal(source):
width = getWidth(source)
height = getHeight(source)
for x in range(width):
for y in range(height):
color = getColor(getPixel(source, y, x))
flipSide = getPixel(source, height-x-1, width-y-1)
setColor(flipSide, color)