Headaches with get()
              in 
             Programming Questions 
              •  
              1 year ago    
            
 
           
             Hi guys,
            
             
            
            
             
            
            
              
           
 
            
           
             I'm not really used to use the get() function and I'm having some trouble with it. I want the program to do something in particular when it finds a pixel with a different colour than the background, but the function, for some reason, returns color 0 with a white background,around the edges of the window. I know that the image I use is completely white except for a black A in the middle, and I've tested it with a black rectangle (generated by processing) and got the same result. This is the code, thanks!:
            
            - size(500,500);
 - int back=255;
 - background(255);
 - PImage test;
 - test=loadImage("test.png");
 - image(test,0,0);
 - rect(200,300,100,100);
 - for(int x=0;x<width;x++){
 - for(int y=0;x<height;y++){
 - colcur=get(x,y);
 - println (colcur);
 - if(colcur!=-1){
 - println(colcur);
 - stroke(255,0,0);
 - line(x,0,x,height);
 - break;
 - }
 - }
 - if(colcur!=-1) break;
 - }
 
 
              
              1  
            
 
            