Skip to content

Commit 4ce8db2

Browse files
committed
createImage: use ARGB/ALPHA constants and set format field
1 parent ed30c5a commit 4ce8db2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Processing.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2529,7 +2529,10 @@ float PApplet::textDescent() {
25292529

25302530
PImage* PApplet::createImage(int w,int h,int mode){
25312531
PImage* img = new PImage(w,h);
2532-
if(mode==3/*ARGB*/) {
2532+
img->format = mode;
2533+
if(mode==ARGB) {
2534+
::std::fill(img->pixels.begin(),img->pixels.end(),0x00000000);
2535+
} else if(mode==ALPHA) {
25332536
::std::fill(img->pixels.begin(),img->pixels.end(),0x00000000);
25342537
}
25352538
img->dirty=true;

0 commit comments

Comments
 (0)