Advertisement
Guest User

drawScalini

a guest
Oct 22nd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1.  
  2. def drawHorizontalLineGen(pict,x,y,w,col):
  3.   #paramentro Picture,int prima coordinata,int seconda coordinata, int w lunghezza linea,Color
  4.   for c in range(x,min(x+w,getWidth(pict))):
  5.     setColor(getPixel(pict,c,y),col)
  6.    
  7. def drawVerticalLineGen(pict,x,y,w,col):
  8.   for f in range(y,min(y+w,getHeight(pict))):
  9.     setColor(getPixel(pict,min(x,getHeight(pict)),f),col)
  10.  
  11.  
  12.  
  13. def drawScalini(pic,x,y,w,z,col):
  14. #x inizio coordinata int, y inizio coordinata y int, w int larghezza scalino,z int altezza scalino
  15.   for i in range(0,(getWidth(pic))):
  16.     drawHorizontalLineGen(pic,x,y,w,col)
  17.     x=x+w    
  18.     drawVerticalLineGen(pic,x,y,z,col)
  19.     y=y+z    
  20.     repaint(pic)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement