Example 9 Given that the longest diagonal of a regular octagon equals $a$, and the shortest diagonal equals $b$. Then the area of the regular octagon is ( ).
(A) $a^{2}+b^{2}$
(B) $a^{2}-b^{2}$
(C) $a+b$
(D) $a b$
(2009, Beijing Middle School Mathematics Competition)
Solve as shown in Figure 9, connect $A E$, $B D$, $D F$, $F H$, and $H B$. It is easy to see that quadrilateral $B D F H$ is a square, and its side length is exactly the shortest diagonal of the regular octagon $ABCDEFGH$:
$$
B H=B D=D F=F H=b,
$$

and $\triangle A B H \cong \triangle C D B \cong \triangle E F D \cong \triangle G H F$.
The longest diagonal of the regular octagon is
$$
A E=B F=C G=D H=a \text {, }
$$

then $A I=E J=\frac{a-b}{2}$,
$$
B I=H I=F J=D J=\frac{b}{2} \text {. }
$$

Therefore, $S_{\text {regular octagon } A B C D E F G H}=S_{\text {square BDFH }}+4 S_{\triangle A B H}$
$$
=b^{2}+4 \times \frac{1}{2}\left(\frac{a-b}{2}\right) \times b=a b \text {. }
$$

Thus, the answer is D.