This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.
Class | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | copy() |
||||||||||||||||||||
Examples | PImage apples; void setup() { size(100, 100); apples = loadImage("apples.jpg"); int x = width/2; apples.copy(x, 0, x, height, 0, 0, x, height); } void draw() { image(apples, 0, 0); } | ||||||||||||||||||||
Description |
Copies a region of pixels from one image into another. If the source and destination regions aren't the same size, it will automatically resize source pixels to fit the specified target region. No alpha information is used in the process, however if the source image has an alpha channel set, it will be copied as well.
As of release 0149, this function ignores imageMode(). |
||||||||||||||||||||
Syntax | pimg.copy() pimg.copy(sx, sy, sw, sh, dx, dy, dw, dh) pimg.copy(src, sx, sy, sw, sh, dx, dy, dw, dh) | ||||||||||||||||||||
Parameters |
| ||||||||||||||||||||
Returns | void or PImage | ||||||||||||||||||||
Related | blend() |
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.