Bonjour,
j'ai écrit une petite méthode pour retourner horizontalement une image mais elle me renvoie une image toute noire...
Si quelqu'un a une idée...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 public static int[][][] inverserImage(int[][][]img, int [][][] tmp){ tmp= new int[img.length][img[0].length][3]; for(int i=img.length; i>0; i--){ for(int j=0; j<img[0].length; j++){ if(i<img.length && j<img[0].length && (img[i][j][0]>0 ||img[i][j][1]>0 ||img[i][j][2]>0)){ tmp[i][j][0]=img[img.length-1][j][0]; tmp[i][j][1]=img[img.length-1][j][1]; tmp[i][j][2]=img[img.length-1][j][2]; } } } }
Partager