Author Topic: How copy a part of screen ?  (Read 2904 times)

0 Members and 1 Guest are viewing this topic.

Offline acjacques

  • Newbie
  • Posts: 33
    • View Profile
How copy a part of screen ?
« on: October 30, 2019, 02:33:43 pm »
Friends;

How use _COPYIMAGE(0) to capture only a part of screen ?

The copied  area wil be further placed in the screen with _PUTIMAGE

Sorry for such so beginners question...

Thanks

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: How copy a part of screen ?
« Reply #1 on: October 30, 2019, 03:55:29 pm »
Why not use PUTIMAGE directly?

Code: QB64: [Select]
  1. 'program copy 320x240 screen part (yellow rectangle) to next screen:
  2.  
  3. SCREEN _NEWIMAGE(1980, 1050, 32)
  4. CLS , &HFFFF0000
  5. LINE (0, 0)-(320, 240), &HFFFFFF00, BF
  6.  
  7. ScreenPart& = _NEWIMAGE(320, 240, 32)
  8.  
  9. _PUTIMAGE , 0, ScreenPart&, (0, 0)-(320, 240) 'copy current (0) screen from area 0,0 to 320, 240 full to new screen named ScreenPart&
  10. PRINT "Press key to view screen ScreenPart:"
  11. SCREEN ScreenPart& 'or use _putimage (destinationX, destionationY) - (destinationX2, destionationY2), destination, source, (sourceX1, sourceY1) - (sourceX2, sourceY2)
  12.  
« Last Edit: October 30, 2019, 03:56:48 pm by Petr »