Advertisement
Guest User

diagonale

a guest
Dec 14th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. def newLine(pic,x,y,c):
  2. #@param pic: picture
  3. #@param x , y: int
  4. #@param c: color
  5. axisX=x
  6. axisY=y
  7. if x>=getWidth(pic)-1 or x<0 or y>=getHeight(pic)-1 or y<0:
  8. print 'parameter error'
  9. return
  10. for param in range(x,getWidth(pic)):
  11. if axisX!=getWidth(pic)-1 and axisY!=getHeight(pic)-1:
  12. px=getPixel(pic,axisX,axisY)
  13. setColor(px,c)
  14. axisX+=1
  15. axisY+=1
  16. elif axisX==getWidth(pic)-1 or axisY==getHeight(pic)-1:
  17. show(pic)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement