createImage()
ImageDescription
Creates a new PImage (the datatype for storing images) with the given width and height.
Syntax
PImage* createImage(int w, int h, int mode)
Parameters
| Name | Type | Description |
|---|---|---|
| w | int | width in pixels |
| h | int | height in pixels |
| mode | int | ARGB or RGB |
Returns
PImage*Related
Under the Hood
From Processing.h:
PImage* createImage(int w, int h, int mode=1);
Under the Hood
From Processing.cpp:
PImage* PApplet::createImage(int w,int h,int mode){
PImage* img = new PImage(w,h);
if(mode==3/*ARGB*/) {
std::fill(img->pixels.begin(),img->pixels.end(),0x00000000);
}
img->dirty=true;
return img;
}