Display Quadrilateral

Hi all,
I have a screen of size 400(H) x 240(V) pixels. I want to display a shaded quadrilateral of given coordinates(four corners). I am trying for a generic alogorithm to display. I am able to develop a generic algoritm for rectangle. Please suggest me the approach for shaded quadrilateral.

Thank you.