Why not just use _CopyImage? http://qb64.org/wiki/COPYIMAGE
Copy image.
Put image.
Free copy.
Done.
It’s basically the process I was going to use to allow _PUTIMAGE to work with the same source and destination, but folks felt the command was confusing enough already and vetoed the alteration.
_CopyImage will copy the entire image.
That’s the entire point. ;)
Say I want to copy and put an area from (100,100)-(200,200) to (400,400)-(500,500) inside the same image. IF _PUTIMAGE worked with the same source and destination, one command would do the trick:
_PUTIMAGE (400,400)-(500,500), source, dest, (100,100)-(200,200)
Since source and dest can’t be the same, without an error, we simply:
temphandle = _COPYIMAGE(dest)
PUTIMAGE (400,400)-(500,500), temphandle, dest, (100,100)-(200,200)
_FREEIMAGE temphandle
Make a copy of the screen with exact same coordinates, image, and all. Simply use the copy as the source and then put what we want from it, back to the original. Then free the copy.