CopyRect.htm 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y,[src_buffer],[dest_buffer]</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. src_x = source top left x location to begin copying from <br />
  13. src_y = source top left y location to begin copying from <br />
  14. src_width = width of source area to copy <br />
  15. src_height = height of source area to copy <br />
  16. dest_x = destination top left x location to copy to <br />
  17. dest_y = destination top left y location to copy to <br />
  18. src_buffer = handle to the source image buffer (optional) <br />
  19. dest_buffer = handle to the destination image buffer (optional)
  20. </td>
  21. </tr>
  22. </table>
  23. <h1>Description</h1>
  24. <table>
  25. <tr>
  26. <td>
  27. Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.
  28. </td>
  29. </tr>
  30. </table>
  31. <h1><a href=../2d_examples/CopyRect.bb>Example</a></h1>
  32. <table>
  33. <tr>
  34. <td>
  35. ; CopyRect Example <br />
  36. <br />
  37. ; Turn on graphics mode <br />
  38. Graphics 800,600,16 <br />
  39. <br />
  40. ; create a blank image <br />
  41. gfxBlank=CreateImage (300,300) <br />
  42. <br />
  43. ; Fill the screen with random boxes in random colors <br />
  44. For t = 1 To 1000 <br />
  45. Rect Rand(800),Rand(600),Rand(100),Rand(100),Rand(0,1) <br />
  46. Color Rand(255),Rand(255),Rand(255) <br />
  47. Next <br />
  48. <br />
  49. ; Wait a couple of seconds so the user can see it <br />
  50. Delay 2000 <br />
  51. <br />
  52. ; Copy graphics randomly from the front buffer to the blank image <br />
  53. CopyRect Rand(800),Rand(600),300,300,0,0,FrontBuffer(),ImageBuffer(gfxBlank) <br />
  54. <br />
  55. ; Clear the screen, draw the copied to image, wait for user to hit a key <br />
  56. Cls <br />
  57. DrawImage gfxBlank,0,0 <br />
  58. WaitKey <br />
  59. </td>
  60. </tr>
  61. </table>
  62. <br>
  63. <a target=_top href=../index.htm>Index</a><br>
  64. <br>
  65. 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>
  66. </html>