Skip to content

Instantly share code, notes, and snippets.

@darrinholst
Created October 8, 2008 15:39
Show Gist options
  • Save darrinholst/15541 to your computer and use it in GitHub Desktop.
Save darrinholst/15541 to your computer and use it in GitHub Desktop.
private void addCrossHatch( Graphics graphics, int width, int height, int x, int y ) {
graphics.setColor( Color.BLACK );
graphics.drawLine( x, y, x + width, y + height );
graphics.drawLine( x + ( width / 2 ), y, x + width, y + ( height / 2 ) );
graphics.drawLine( x, y + ( height / 2 ), x + ( width / 2 ), y + height );
graphics.drawLine( x, y + (int) ( height * .6 ), x + (int) ( width * .6 ), y );
graphics.drawLine( x + (int) ( width * .4 ), y + height, x + width, y + (int) ( height * .4 ) );
graphics.drawRect( x, y, width, height );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment