public void paintComponent(Graphics g){
        try {
            Integer x0=788;//828;
            Integer y0=828;
            Integer jvar=300;
            Integer ivar=300;
            Integer xrapport=x0/(8700/ivar);
            Integer yrapport=y0/(4465/jvar);

            Image img = ImageIO.read(new File("map.png"));
            g.drawImage(img, 0, 0, this); //829x788
            for(int j=0; j<4465; j=j+jvar) for(int i=0; i<8700; i=i+ivar){
               int somme=0;
                Color colzone;
               for(int k=j; k<j+jvar; k++) for (int l=i; l<i+ivar; l++){
               if (carte.getprop(l,k)>7) somme += 7; else somme +=carte.getprop(l,k);
               }
               int indice=somme/200;
               if(indice>255) indice=255;
               Integer x=(829*i)/8700;
               Integer y=y0-(j*788)/4465;
               if(indice>0){
                   colzone = new Color(indice,0,(255-indice),127);
                   g.setColor(colzone);
                   g.fillRect(x,y,xrapport,yrapport);
               }else if (indice==0){
                   colzone = new Color(255,255,255,127);
                   g.setColor(colzone);
                   g.fillRect(x,y,xrapport,yrapport);
               }
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }