Name |
createImage()创建图像 |
||||||
Examples |
PImage img = createImage(66, 66, RGB); img.loadPixels(); for (int i = 0; i < img.pixels.length; i++) { img.pixels[i] = color(0, 90, 102); } img.updatePixels(); image(img, 17, 17);
PImage img = createImage(66, 66, ARGB); img.loadPixels(); for (int i = 0; i < img.pixels.length; i++) { img.pixels[i] = color(0, 90, 102, i % img.width * 2); } img.updatePixels(); image(img, 17, 17); image(img, 34, 34); |
||||||
Description |
Creates a new PImage (the datatype for storing images). This provides a fresh buffer of pixels to play with. Set the size of the buffer with the width and height parameters. The format parameter defines how the pixels are stored. See the PImage reference for more information. Be sure to include all three parameters, specifying only the width and height (but no format) will produce a strange error. Advanced users please note that createImage() should be used instead of the syntax new PImage(). 创建新的 PImage (用于存储图像的数据类型)。这提供了一个新的像素缓冲区来播放。使用宽度和高度参数设置缓冲区的大小。格式参数定义像素的存储方式。有关更多信息, 请参见 PImage 参考。
确保包含所有三参数, 只指定宽度和高度 (但没有格式) 将产生一个奇怪的错误。
高级用户请注意, 应使用 createImage () 代替语法新 PImage ()。 |
||||||
Syntax |
createImage(w, h, format) |
||||||
Parameters |
|
||||||
Returns |
PImage |
||||||
Related |
PImage |
- 本文固定链接: http://iprocessing.cn/2017/08/08/createimage创建图像/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表