Welcome to the forum.
Just a couple of things, please do not include screenshots of code and error messages. Forum members cannot run the code to try and duplicate the problem and thereby find a solution.
Instead of the image copy and paste the code into the message, then select the code in the message and click on the </> button to format the code for this forum.
The problem in your code is that the variables (backgroundColor
, circleColor
, circleStroke
) holding your colours are declared as float
and should be int
thank you !
sorry~This is my first time using the forum.
I will paste the code into the message next time
thank you again!
No need to apologise we all started here in the same way
Hello ! teacher ! Now all my code is going to come up with this warning.
I don`t know happened.The example of yesterday’s modification still exists and the empty documents also have this warning.
This is my code.
code_1
void setup(){
size(1000,1000);
background(125);
}
void draw(){
stroke(0);
rectMode(CENTER);
rect(200,300,300,300);
}
code_2
float lineX = 512;
float lineY = 512;
float lineH = 0;
float lineW = 0;
float lineFill = 125;
float lineStroke = 0;
float backgroundColor =255;
float change = 1;
void setup()
{
size(1024, 1024);
}
void draw()
{
background(backgroundColor);
stroke(lineStroke);
fill(lineFill);
line(lineX, lineY, lineH+512, lineW);
line(lineX, lineY, lineH+1024, lineW+1024);
line(lineX, lineY, lineH, lineW+1024);
lineW=lineW+change;
}
code_1 used processing 3.5.3
code_2 used processing 3.5.4
There were no warnings in the 3.5.3 release, but now it still appear warnings when I switch back to the old version.
How to solve the libpng warning ? What is the libpng warning mean? Thanks ! Love you!!
I am also using Processing 3.5.4 and I have tried your 2 programs and an empty sketch and I don’t get this warning.
Since you get the warning on your computer even if you run an empty sketch it can’t be your code creating it, it must be some internal function of Processing, in which case I suggest you simply ignore it.
Anyway I did a bit of googling and it seems that is caused when loading a png image file with an invalid iCCP chunk and can be safely ignored. There is nothing you can do about it yourself.
I notice in code2
you did not follow my advice and change the color variables to ints
like this.
float lineX = 512;
float lineY = 512;
float lineH = 0;
float lineW = 0;
int lineFill = 125;
int lineStroke = 0;
int backgroundColor =255;
float change = 1;
oh ! I got it wrong~
I thought you meant to change the float value of the variable from 0.5 to 1
So I changed value of the float change
My English reading ability still needs to be improved.
Thank you teacher !! I will study hard!!