public void setZoom(int _zoom) {
	  zoom = _zoom;
	  Image offpt=createImage(width*zoom +1, height*zoom +1);
	  offpt.getGraphics().drawImage(offsetPaint, 0, 0, width*zoom +1, height*zoom +1, null);
	  offsetPaint.flush();
	  offsetPaint=offpt;
	  selection = new BufferedImage(width*zoom + 1, height*zoom + 1, BufferedImage.TYPE_INT_ARGB);
	  grid = new BufferedImage(width*zoom + 1, height*zoom + 1, BufferedImage.TYPE_INT_ARGB);
	  Graphics g = grid.getGraphics();
	  g.setColor(new Color(0, 0, 0, 50));
	  for (int x = 0; x <width*zoom; x=x+(8*zoom)) {
		  for (int y=0;y<height*zoom;y=y+(8*zoom)) {
			  g.drawRect(x, y, 8*zoom, 8*zoom);
		  }
	  }
	  toRefresh=true;
	  refreshSelection=true;
	  repaint();
  }