首页 > 文档 > copy()复制像素
2017
08-09

copy()复制像素

Name

copy()复制像素

   

Examples

copy()复制像素 - 第1张  | Processing编程艺术copy()复制像素 - 第2张  | Processing编程艺术copy()复制像素 - 第3张  | Processing编程艺术

PImage img = loadImage(“eames.jpg”);

image(img, 0, 0, width, height);

copy(7, 22, 10, 10, 35, 25, 50, 50);

stroke(255);

noFill();

// Rectangle shows area being copied

rect(7, 22, 10, 10);

Description

Copies a region of pixels from the display window to another area of the display window and copies a region of pixels from an image used as the srcImg parameter into the display window. If the source and destination regions aren’t the same size, it will automatically resize the 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().

将显示窗口中的像素区域复制到显示窗口的另一个区域, 并将图像中用作 srcImg 参数的像素区域复制到显示窗口中。如果源和目标区域的大小不相同, 它将自动调整源像素大小以适应指定的目标区域。进程中不使用 alpha 信息, 但是如果源图像具有 alpha 通道集, 则也会复制它。

 

0149版中, 此函数忽略 imageMode ()

Syntax

copy()

copy(sx, sy, sw, sh, dx, dy, dw, dh)

copy(src, sx, sy, sw, sh, dx, dy, dw, dh)

Parameters

sx

int: X coordinate of the source’s upper left corner

源左上角的 X 坐标

sy

int: Y coordinate of the source’s upper left corner

源左上角的 Y 坐标

sw

int: source image width

源图像宽度

sh

int: source image height

源图像高度

dx

int: X coordinate of the destination’s upper left corner

目标左上角的 X 坐标

dy

int: Y coordinate of the destination’s upper left corner

目标左上角的 y 坐标

dw

int: destination image width

目标图像宽度

dh

int: destination image height

目标图像高度

src

PImage: an image variable referring to the source image.

引用源图像的图像变量。

Returns

void or PImage

Related

alpha()
blend()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。