68 lines
2.0 KiB
HTML
68 lines
2.0 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y,[src_buffer],[dest_buffer]</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
src_x = source top left x location to begin copying from
|
|
<br />
|
|
src_y = source top left y location to begin copying from
|
|
<br />
|
|
src_width = width of source area to copy
|
|
<br />
|
|
src_height = height of source area to copy
|
|
<br />
|
|
dest_x = destination top left x location to copy to
|
|
<br />
|
|
dest_y = destination top left y location to copy to
|
|
<br />
|
|
src_buffer = handle to the source image buffer (optional)
|
|
<br />
|
|
dest_buffer = handle to the destination image buffer (optional)
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/CopyRect.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; CopyRect Example
|
|
<br />
|
|
|
|
<br />
|
|
; Turn on graphics mode
|
|
<br />
|
|
Graphics 800,600,16
|
|
<br />
|
|
|
|
<br />
|
|
; create a blank image
|
|
<br />
|
|
gfxBlank=CreateImage (300,300)
|
|
<br />
|
|
|
|
<br />
|
|
; Fill the screen with random boxes in random colors
|
|
<br />
|
|
For t = 1 To 1000
|
|
<br />
|
|
Rect Rand(800),Rand(600),Rand(100),Rand(100),Rand(0,1)
|
|
<br />
|
|
Color Rand(255),Rand(255),Rand(255)
|
|
<br />
|
|
Next
|
|
<br />
|
|
|
|
<br />
|
|
; Wait a couple of seconds so the user can see it
|
|
<br />
|
|
Delay 2000
|
|
<br />
|
|
|
|
<br />
|
|
; Copy graphics randomly from the front buffer to the blank image
|
|
<br />
|
|
CopyRect Rand(800),Rand(600),300,300,0,0,FrontBuffer(),ImageBuffer(gfxBlank)
|
|
<br />
|
|
|
|
<br />
|
|
; Clear the screen, draw the copied to image, wait for user to hit a key
|
|
<br />
|
|
Cls
|
|
<br />
|
|
DrawImage gfxBlank,0,0
|
|
<br />
|
|
WaitKey
|
|
<br />
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CopyRect&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|