//the integer coordinates
int y_start = (int)((p[0][1] - tl[1])/hpp +.5); //round start up
int x_start = (int)((p[0][0] - tl[0])/wpp +.5);
int y_end = (int)((p[1][1] - tl[1])/hpp +.5); //and ends up
int x_end = (int)((p[1][0] - tl[0])/wpp +.5);
//the integer coordinates
int y_start = (int)((p[0][1] - tl[1])/hpp +.5); //round start up
int x_start = (int)((p[0][0] - tl[0])/wpp +.5);
int y_end = (int)((p[1][1] - tl[1])/hpp +.5); //and ends up
int x_end = (int)((p[1][0] - tl[0])/wpp +.5);