dxCopyRect%(src_x%,src_y%,src_width%,src_height%,dest_x%,dest_y%,src_buffer%,dest_buffer%)

Parameters

src_x = source top left x location to begin copying from
src_y = source top left y location to begin copying from
src_width = width of source area to copy
src_height = height of source area to copy
dest_x = destination top left x location to copy to
dest_y = destination top left y location to copy to
src_buffer = handle to the source image buffer (optional)
dest_buffer = handle to the destination image buffer (optional)

Description

Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.

Example

; dxCopyRect Example

; Turn on graphics mode
Graphics 800,600,16

; create a blank image
gfxBlank=dxCreateImage (300,300)

; Fill the screen with random boxes in random colors
For t = 1 To 1000
dxRect dxRand(800),dxRand(600),dxRand(100),dxRand(100),dxRand(0,1)
dxColor dxRand(255),dxRand(255),dxRand(255)
Next

; Wait a couple of seconds so the user can see it
Delay 2000

; Copy graphics randomly from the front buffer to the blank image
dxCopyRect dxRand(800),dxRand(600),300,300,0,0,dxFrontBuffer(),dxImageBuffer(gfxBlank)

; Clear the screen, draw the copied to image, wait for user to hit a key
dxCls
DrawImage gfxBlank,0,0
dxWaitKey

Index