Skip to content

Instantly share code, notes, and snippets.

@craigmccauley
Created January 25, 2020 09:50
Show Gist options
  • Save craigmccauley/20c95e58345e63a39e5fcbf4b57e52d9 to your computer and use it in GitHub Desktop.
Save craigmccauley/20c95e58345e63a39e5fcbf4b57e52d9 to your computer and use it in GitHub Desktop.
ImageJ 40 by 40 box on cursor location
//make rectange 40 by 40 on cursor location
//get location of cursor
var cursorX, cursorY, cursorZ, buttonFlags;
getCursorLoc(cursorX, cursorY, cursorZ, buttonFlags);
//set rectange vars
var rectangleWidth = 40;
var rectangleHeight = 40;
var rectangleX = cursorX - (rectangleWidth / 2);
var rectangleY = cursorY - (rectangleHeight / 2);
makeRectangle(rectangleX, rectangleY, rectangleWidth, rectangleHeight);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment