4. As shown in Figure 2, in the right trapezoid $A B C D$, $A B / /$ $D C, \angle B=90^{\circ}$, a moving point $P$ starts from point $B$ and moves along the sides of the trapezoid in the order $B \rightarrow C \rightarrow D \rightarrow A$. Let the distance traveled by $P$ be $x$, and the area of $\triangle A B P$ be $y$. Consider $y$ as a function of $x$, and the graph of the function 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$. Then we find $A B=8$. Therefore, $S_{\triangle A B C}=\frac{1}{2} \times 8 \times 4=16$.