Advertisement
GabrielePozzoli

barraDiagonale

Oct 20th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. def barraDiag(pict,w,col):
  2. # @param pict: Picture
  3. # @param w: int; larghezza della diagonale
  4. # @param col: Color
  5.   for h in range(0,getHeight(pict)):
  6.     drawLine(pict,h,h,w,col)
  7.   repaint(pict)
  8.  
  9.  
  10. def drawLine(pict,x,y,w,col):
  11. # @param pict:Picture
  12. # @param x: Int; Coordinata dell'immagine
  13. # @param y: Int; Coordinata dell'immagine
  14. # @param w: int; lunghezza della riga
  15. # @param col: Color
  16.   for i in range(x,min(x+w,getWidth(pict))):
  17.     pix=getPixel(pict,i,y)
  18.     setColor(pix,col)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement