I am trying to copy the Right portion of frame data. The image below could be useful. Data is in single array form.
I want to get single array right column of data frame.
I am getting "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1000
". I am not sure what's wrong.
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1000
public static void main(String args[]) {
int height=10;
int width = 100;
int data[]= new int [height*width];
int multipiler=0;
int counter =1;
int hwAssistWidth=5;
int hwData[] = new int[hwAssistWidth*height];
int countTheFrame = 0;
int countTheFrame1 = 0;
int sourceArray;
for(int i=0; i<hwAssistWidth*height; i++){
sourceArray = ((width-hwAssistWidth)+width*multipiler)+counter++;
hwData[i] = data[sourceArray];
if (counter==hwAssistWidth+1){
counter =1;
multipiler++;
if(multipiler==height){
break;
}
}
}
}