Let the line equation be y=mx+b where m is the slope and b the y intercept. The x intercept is -b/m.
The triangle is formed by joining the intercepts, so that the legs of the right triangle are b and -b/m. The area of the triangle is -b^2/2m (1/2 base times height)=4. So m=-b^2/8.
Therefore the equation becomes y=-xb^2/8+b substituting for m.
Now we put x=1, y=2 into this equation: 2=-b^2/8+b which becomes b^2-8b+16=(b-4)^2=0 so b=4, m=-16/8=-2 and the equation of the line is y=-2x+4.
