4. Right trapezoid $A B C D$ is shown in Figure 2, and a moving point $P$ starts from $B$, moving along the sides of the trapezoid in the order $B \rightarrow C \rightarrow D \rightarrow A$. Let the distance traveled by point $P$ be $x$, and the area of $\triangle A B P$ be $f(x)$.

If the graph of the function $y=f(x)$ is shown in Figure 3, then the area of $\triangle A B C$ is ( ).
(A) 10
(B) 16
(C) 18
(D) 32
4. B.

According to the image, we get $B C=4, C D=5, D A=5$. Therefore, $A B=8$.
Thus, $S_{\triangle A B C}=\frac{1}{2} \times 8 \times 4=16$.