QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: jamesmustain on February 05, 2021, 11:26:55 pm
-
Hi guys,
How to use _COPYIMAGE(0) to capture only a part of screen ?
The copied area wil be further placed in the screen with _PUTIMAGE. Many Thanks!
-
Read _PutImage carefully, there are arguments for both controlling the screen section to copy and controlling where in screen or another image you want to put that image. https://www.qb64.org/wiki/PUTIMAGE
Welcome to forum!
_PutImage is like a copy / paste in one step but pretty hairy looking when you first encounter it.
-
Easy wayis with _NEWIMAGE and _PUTIMAGE.
Say my main screen is 1024x720 in size.
I want to copy from (200,200)-(400,400)
That’s a 200x200 area of the screen, so I’d:
my_copy = _NEWIMAGE(200, 200, 32)
_PUTIMAGE (0,0), 0, my_copy, (200,200)-(400,400)
Now I have a new image with the partial part which I wanted to do whatever with.
-
That's a nice building block, but I'll be darned if I can figure out what it would be useful for.
Pete