Develop the equation of the line which connects the two oblique vertices $\;\{(0, a) \text{and} (b, 0)\}.\quad$$\;\{(0, a) \text{and} (b, 0)\}.\qquad\qquad$ It is assumed that these two points are lattice points, of course.
Then solve as a linear Diophantine equation, yielding $\;\{x = c + dt;\quad y = e + ft\}.$
Then solve the two inequations $\;\{c + dt \ge 0 \; \text{and} \; e + ft \ge 0\}.$
This should yield a range $\;[g, h]\quad$ of valid values for $\;t.\quad$ Each of these values, substituted into the two expressions for $\;x\quad$ and $\;y,\quad$ will give you a lattice point of the hypotenuse.
The number of these (the question you asked) will be
max(g, h) - min(g, h) + 1.