Name |
PImage图像数据类型 |
||||||||||||||||||||
Examples |
PImage photo;
void setup() { size(100, 100); photo = loadImage(“laDefense.jpg”); }
void draw() { image(photo, 0, 0); } |
||||||||||||||||||||
Description |
Datatype for storing images. Processing can display .gif, .jpg, .tga, and .png images. Images may be displayed in 2D and 3D space. Before an image is used, it must be loaded with the loadImage()function. The PImage class contains fields for the width and height of the image, as well as an array called pixels[] that contains the values for every pixel in the image. The methods described below allow easy access to the image’s pixels and alpha channel and simplify the process of compositing. Before using the pixels[] array, be sure to use the loadPixels() method on the image to make sure that the pixel data is properly loaded. To create a new image, use the createImage() function. Do not use the syntax new PImage(). 用于存储图像的数据类型。处理可以显示. gif、. jpg、. tga 和. png 图像。图像可以显示在2D 和3D 空间中。在使用图像之前, 必须使用 loadImage () 函数来加载它。PImage 类包含图像的宽度和高度的字段, 以及一个名为像素 [] 的数组, 其中包含图像中每个像素的值。下面描述的方法可以方便地访问图像的像素和 alpha 通道, 并简化合成过程。
在使用像素 [] 数组之前, 请确保对图像使用 loadPixels () 方法, 以确保正确加载像素数据。
要创建新图像, 请使用 createImage () 函数。不要使用语法新的 PImage ()。 |
||||||||||||||||||||
Fields |
|
||||||||||||||||||||
Methods |
|
||||||||||||||||||||
Constructor |
PImage(width, height, format, factor) |
||||||||||||||||||||
Related |
loadImage() |
- 本文固定链接: http://iprocessing.cn/2017/08/08/pimage图像数据类型/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表