FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
    Examples \ Tutorials \ Courses & Workshops
 
   
 
 
Examples for Processing (BETA) version 91+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.



Width and Height
by REAS <http://reas.com>

The 'width' and 'height' variables contain the width and height of the display window as defined in the size() function.

Created 27 October 2002

   
// Width and Height 
// by REAS <http://reas.com> 

size(200, 200); 
background(127); 
noStroke(); 
for(int i=0; i<height; i+=20) { 
  fill(0); 
  rect(0, i, width, 10); 
  fill(255); 
  rect(i, 0, 10, height); 
} 
 







   
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info