Class | PImage | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | copy() |
||||||||||||||||||||
Examples | // @pjs preload must be used to preload the image /* @pjs preload="tower.jpg"; */ PImage img = loadImage("tower.jpg"); img.copy(50, 0, 50, 100, 0, 0, 50, 100); image(img, 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. This function ignores imageMode(). |
||||||||||||||||||||
Syntax | img.copy(sx,sy,swidth,sheight,dx,dy,dwidth,dheight) img.copy(srcImg,sx,sy,swidth,sheight,dx,dy,dwidth,dheight) |
||||||||||||||||||||
Parameters |
|
||||||||||||||||||||
Returns | None | ||||||||||||||||||||
Usage | Web & Application | ||||||||||||||||||||
Related | alpha() blend() |