question: public void picture ( double x , double y , String s , double w , double h ) { Image image = getImage ( s ) ; double xs = scaleX ( x ) ; double ys = scaleY ( y ) ; double ws = factorX ( w ) ; double hs = factorY ( h ) ; if ( ws < 0 || hs < 0 ) throw new IllegalArgumentException ( "image " + s + " is corrupt" ) ; if ( ws <= 1 && hs <= 1 ) pixel ( x , y ) ; else { offscreen . drawImage ( image , ( int ) Math . round ( xs - ws / 2.0 ) , ( int ) Math . round ( ys - hs / 2.0 ) , ( int ) Math . round ( ws ) , ( int ) Math . round ( hs ) , null ) ; } draw ( ) ; }
target:  Draws picture (gif, jpg, or png) centered on (x, y), rescaled to w-by-h.