Looks like you are mixing "active" and "static" modes

void placeRectangle2() {

  myRect = loadImage("myRect.jpg");
  myRect.loadPixels();
  loadPixels();
  for(int j=0;j<height;j++){
    for(int i=0;i<width;i++){
      int loc=i+j*width;
         pixels[loc]=myRect.pixels[loc];
      }        
     } 
    }
  updatePixels(); 
  myRect.updatePixels();  
}

updatePixels(); is flagged with “Looks like you are mixing “active” and “static” modes” I cannot find the error??? A previous function that is virtually the same runs without error.

Hello @RobM,

This will happen if you do not have complementary opening and closing brackets.

You can highlight the opening bracket and it will show the complementary closing bracket:

I can see an extra bracket in there.

:)

1 Like

Thank you. I can’t believe I missed that.

2 Likes