home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / bobs / exam01.dba < prev    next >
Encoding:
Text File  |  1999-09-07  |  1.4 KB  |  62 lines

  1. Rem * Title  : Grabbing Images
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ===================================================
  5. rem DARK BASIC EXAMPLE PROGRAM 1
  6. rem ===================================================
  7. rem This program will grab a image from a bitmap
  8. rem ---------------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.  
  13. rem Load a bitmap on to the screen
  14. load bitmap "face.bmp"
  15.  
  16. rem Load back ground to bitmap 1
  17. load bitmap "back.bmp",1
  18.  
  19. rem Shen you load a bitmap that bitmap becomes the current bitmap
  20. rem where all drawing is done 
  21.  
  22. rem Use this command to set drawing to the screen
  23. set current bitmap 0 
  24.  
  25. rem Grab image 1 from bitmap
  26. get image 1,18,17,156,196
  27.  
  28. rem Grab image 2 from bitmap
  29. get image 2,207,29,341,198
  30.  
  31. rem Grab image 3 from bitmap
  32. get image 3,404,21,535,209
  33.     
  34. rem Copy background to screen
  35. copy bitmap 1,0
  36.  
  37. screenwidth=640
  38. screenheight=480
  39. repeat
  40.  
  41.     rem paste all the images at random places
  42.     paste image 1,rnd(screenwidth),rnd(screenheight)
  43.     paste image 2,rnd(screenwidth),rnd(screenheight)
  44.     paste image 3,rnd(screenwidth),rnd(screenheight)
  45.  
  46. until mouseclick()=1
  47.  
  48. rem Clear the screen
  49. cls 
  50.  
  51. rem Remove image 1 from memory
  52. delete image 1
  53.  
  54. rem Remove image 2 from memory
  55. delete image 2
  56.  
  57. rem Remove image 3 from memory
  58. delete image 3
  59.  
  60. rem End the program
  61. end
  62.