Seems like we are close to painting enclosed (or framed by screen) areas, an exercise we recently experimented with in the Paint Image thread. I wonder how this code compares?
I would use the scan line polygon fill to accomplish filling an area when ever possible
https://www.qb64.org/forum/index.php?topic=1946.0. For simple polygon shapes, polyFill is the way to go. What I mean by simple is that the number of polygon vertices should be below a threshold of 100 vertices. There is no practical limit to the number of vertices that can be processed by this algo, but the monotonous effort of converting all of the vertices of let's say of a 'perfect' maze image with an entrance and an exit to x/y coordinates would be a nightmare. You could of course use a polygon editor to plot all of those vertices to x/y coords, but it is still very tedious. (Link for JB Polygon Editor
http://jbfilesarchive.com/phpBB3/download/file.php?id=1614 )
With the Scan Line Filled Polygon link above, the 62 vertices jigsaw piece shaped polygon is filled within 2ms - 3ms on my laptop. Is that fast or slow when compared to yours and Steve's method?
Andy do you know about working images in separate destination and using as needed with _PUTIMAGE or _MAPTRIANGLE, setup a drawing area and handle& with _NEWIMAGE.
I know conceptually how to do all of those things in QB64 but still am figuring out all the syntactic nuances. In BlitzPlus basic I'd use 'imagehandle% - CreateImage(width, height) just like 'imagehandle& = _NewImage(width, height, 32), easy peasy.
It's the _Source, _Dest, _PutImage while easy enough to understand the concepts, the syntax is a bit of a drain on my nerves, not that there's anything wrong with the commands, just saying...