I need to draw the closest thing to a major diagonal on a picture(irregular matrix). I already know that for a regular one the format is the following:
for (i = 0; i < row; i++) {
for (j = 0; j < column; j++) {
if(i==j){
matrix[row][column] = color_of_diagonal;
}
}
}
But adapt that to a rectangle is obiviously different... I saw some note algorithm but i didn't understood very well their work. Someone could help me?
P.S.: It would be cool if it could be explained a way to draw multiple "diagonal" lines on the image too, but that's not the main problem.