this brings me back to my old days of Amstrad coding... anyway
if the shape is regular (ie a box) then you could build a filling routine where you fill it up with predefined polygons (say a 1x1 image, or even better a 1x1 image that you can stretch to a width). what you do is a bit like a path-finding algorithm... you figure which side of the line is your box... and then you move left and right to find an edge (c2 can do that) and then you can move up and down. or you can travel along an edge and infill. It begins to fail with complicated shapes, and it will not be fast as writing it natively.
it's not easy but it is doable. I suspect it's beyond a beginner
PS: as an early newbie, I never got my fill algorithms to work correctly.