12. Place a valuable right-angled triangular metal plate $A B O$ in a Cartesian coordinate system (as shown in the figure), given that $A B=B O=1$ (m), $A B \perp O B$. Now, due to the damaged part of the triangular plate, a line $M N$ passing through point $P\left(\frac{1}{2}, \frac{1}{4}\right)$ is to be used to cut off the damaged part. How should the slope of line $M N$ be determined so that the area of the resulting triangular plate $\triangle A M N$ is maximized?
12. Let the slope of line $M N$ be $k$, then the equation of line $M N$ is
$$
y-\frac{1}{4}=k\left(x-\frac{1}{2}\right) \text {. }
$$

Since the coordinates of point $A$ are $(1,1)$, the equation of line $O A$ is
$$
y=x .
$$

Solving (1) and (2) simultaneously, we get $M\left[\frac{2 k-1}{4(k-1)}, \frac{2 k-1}{4(k-1)}\right],(k \neq 1)$.
Since the equation of line $A B$ is $x=1$, we have $N\left(1, \frac{2 k+1}{4}\right)$.
Thus, $S_{\triangle M N}=\frac{1}{2} \cdot A N \cdot h=\frac{1}{2}\left(1-\frac{2 k+1}{4}\right)\left[1-\frac{2 k-1}{4(k-1)}\right]=\frac{1}{32} \cdot \frac{(3-2 k)^{2}}{1-k}=\frac{1}{32}[4(1-k)+$ $\left.\frac{1}{1-k}+4\right]$
Since $k_{o p}=\frac{\frac{1}{4}-0}{\frac{1}{2}-1}=\frac{1}{2}, k_{p B}=\frac{\frac{1}{4}-0}{\frac{1}{2}-1}=-\frac{1}{2}$, we have $-\frac{1}{2} \leqslant k \leqslant \frac{1}{2}$.
Thus, $\frac{1}{2} \leqslant 1-k \leqslant \frac{3}{2}$, and at this time, $S$ is an increasing function.
Therefore, when $1-k=\frac{3}{2}$, i.e., $k=-\frac{1}{2}$, $S_{\max }=\frac{1}{3}$.
Hence, when the slope of line $M N$ is $-\frac{1}{2}$, the area of the triangular board $A M N$ is maximized.