Formula used:
Count triangles by types and add:
Type I: small right triangles formed inside unit squares where an outer diagonal passes (corner unit triangles).
Type II: right triangles whose hypotenuse lies along a long diagonal segment of the big-square diagonal (spanning 1,2 or 3 unit lengths).
Type III: triangles having two sides along the two big diagonals (they meet at the center) and base along a grid line (horizontal or vertical).
Calculations:

Type I: corners — each of 4 corner unit squares is split by a diagonal → 2 triangles each.
⇒ 4 × 2 = 8
Type II: triangles with hypotenuse on a big diagonal. For one diagonal there are 3 adjacent lattice-step hypotenuses (k=1) + 2 step-2 hypotenuses (k=2) + 1 step-3 hypotenuse (k=3). Each hypotenuse gives 2 right triangles (above and below).
⇒ per diagonal: (3 + 2 + 1) × 2 = 6 × 2 = 12
⇒ two diagonals would seem to give 12 × 2 = 24, but that double-counts triangles symmetric to both diagonals that were already counted in Type I (the small corner unit triangles). Those 4 corner unit triangles were included twice, so unique Type II total = 24 − 4 = 20.
However it is simpler to combine consistently as:
Per diagonal unique right-triangles (excluding the 4 corner unit triangles already in Type I) = 6 ⇒ both diagonals = 12.
So take:
⇒ Type II (unique) = 12
Type III: apex at center (intersection of diagonals). For each of the 4 rows and 4 columns where the two diagonal lattice-points lie on same row/column, there is one triangle with base that row/column and apex at center.
⇒ 4 (horizontal rows) + 4 (vertical columns) = 8
Total triangles = Type I + Type II + Type III
⇒ 8 + 12 + 8 = 28
∴ The correct answer is 28.