Draw flat shape and plane borders

How to draw a border around a flat shape and fill the interior of this shape with material? It’s supposed to look something like this, but it’s not necessarily a rectangle:

https://api.asm.skype.com/v1/objects/0-neu-d1-67e33a8e76c1b9a0ee57f940654b8cac/views/imgpsh_fullsize

Can be it done only with one material? Are splines necessary? Can it be easily done with an arbitrary shape?