Alternative to using get() in a big PGraphics

http://processing.github.io/processing-javadocs/core/processing/core/PGraphics.html#image-processing.core.PImage-float-float-float-float-int-int-int-int-

First 4 floats are the rectangle that you want to draw the image (or part of it) into, as x, y, width and height. The 4 ints are the coordinates of the two points in the source image that define the region. Note that the last two arguments are the absolute coordinates not the width and height of the source region.

eg. to draw a region 200,150 of your map with top left 400,300 at 100,100 on screen you would use

image(map, 100, 100, 200, 150, 400, 300, 600, 450);

For some reason this isn’t on the image() page at image() / Reference / Processing.org Seems to be an odd omission.

4 Likes