createImage()

Image

Description

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

NameTypeDescription
wintwidth in pixels
hintheight in pixels
modeintARGB 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; }