Advertisement
stefano_p

Rotazione -- 90°OPPOSTO

Apr 10th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. def rotazione_90(pic,canvas):
  2. #@ param pic:picture
  3. #@ param canvas : picture (canvas > pic
  4.   if getWidth(canvas) and getHeight(canvas)<=getWidth(pic) and getHeight(pic):
  5.     return ("il canvas e' troppo piccolo" )
  6.    
  7.   #pic=makePicture(pickAFile())
  8.   #canvas=makePicture(pickAFile())
  9.  
  10.   for pic_x in range(0,getWidth(pic)):
  11.     canvas_y=pic_x
  12.     for pic_y in range (0,getHeight(pic)):
  13.       canvas_x=pic_y
  14.       color=getColor(getPixel(pic,pic_x,pic_y))
  15.       setColor(getPixel(canvas,canvas_x,canvas_y),color)
  16.   repaint(canvas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement