home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / bitmap / exam06.dba < prev    next >
Encoding:
Text File  |  2000-01-24  |  3.3 KB  |  172 lines

  1. Rem * Title  : Bitmap Editing
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 6
  6. rem ==========================================
  7. rem This program will play about with 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 picture
  14. load bitmap "pics\bitmap0.bmp",1
  15.  
  16. rem This command will copy one bitmap to another    
  17. copy bitmap 1,0
  18.  
  19. rem Draw on bitmap 0 only
  20. set current bitmap 0
  21.  
  22. rem press 1 to fade this bitmap
  23. rem press 2 to blur this bitmap
  24. rem press 3 to flip this bitmap
  25. rem press 4 to mirror this bitmap
  26. rem press 5 to check if this bitmap has benn mirrored
  27. rem press 6 to check if the bitmap has been flipped
  28. rem press 7 to get info on this bitmap
  29.  
  30. do
  31.  
  32.     rem press key 1 to fade bitmap by 75 persent
  33.     if keystate(2)>0
  34.  
  35.         rem this command will hide the mouse pointer
  36.         hide mouse
  37.         
  38.         rem clear screen
  39.         cls 0
  40.  
  41.         rem copy bitmap 1 to bitmap 0
  42.         copy bitmap 1,0
  43.  
  44.         print "fading bitmap"
  45.  
  46.         rem fade a bitmap
  47.         fade bitmap 0,75
  48.  
  49.         print "done"
  50.  
  51.         rem this command will show the mouse pointer on screen
  52.         show mouse
  53.  
  54.     endif
  55.  
  56.     rem press key 2 will blur bitmap 
  57.     if keystate(3)>0
  58.  
  59.         rem this command will hide the mouse pointer
  60.         hide mouse
  61.  
  62.         rem clear screen
  63.         cls 0
  64.  
  65.         rem copy bitmap 1 to bitmap 0
  66.         copy bitmap 1,0
  67.  
  68.         print "blur bitmap"
  69.  
  70.         rem thgis command will blur the bitmap 
  71.         blur bitmap 0,3
  72.  
  73.         rem this command will show the mouse pointer on screen
  74.         show mouse
  75.  
  76.         print "done"
  77.     endif
  78.  
  79.     rem press key 3
  80.     if keystate(4)>0
  81.  
  82.         rem this command will hide the mouse pointer
  83.         hide mouse
  84.  
  85.         flip bitmap 0
  86.  
  87.         rem this command will show the mouse pointer on screen
  88.         show mouse
  89.  
  90.     endif
  91.  
  92.     rem press key 4
  93.     if keystate(5)>0
  94.  
  95.         rem this command will hide the mouse pointer
  96.         hide mouse
  97.  
  98.         rem this command will mirror a bitmap
  99.         mirror bitmap 0
  100.  
  101.         rem this command will show the mouse pointer on screen
  102.         show mouse
  103.  
  104.     endif
  105.  
  106.     rem press key 5
  107.     if keystate(6)>0
  108.  
  109.         rem this command will hide the mouse pointer
  110.         hide mouse
  111.  
  112.         rem this command will see if the bitmap has been mirror 
  113.  
  114.         if bitmap mirrored(0)=1
  115.             print "This bitmap has been mirrored"
  116.         else
  117.             print "This bitmap has not mirrored"
  118.         endif
  119.  
  120.         rem this command will show the mouse pointer on screen
  121.         show mouse
  122.  
  123.     endif
  124.  
  125.     rem press key 6
  126.     if keystate(7)>0
  127.  
  128.         rem this command will hide the mouse pointer
  129.         hide mouse
  130.  
  131.         rem this command will see if the bitmap has been mirror 
  132.  
  133.         if bitmap flipped(0)=1
  134.             print "This bitmap has been flipped"
  135.         else
  136.             print "This bitmap has not flipped"
  137.         endif
  138.  
  139.         rem this command will show the mouse pointer on screen
  140.         show mouse
  141.  
  142.     endif
  143.  
  144.     rem press key 7
  145.     if keystate(8)>0
  146.  
  147.         rem this command will hide the mouse pointer
  148.         hide mouse
  149.  
  150.         rem clear screen
  151.         cls 0
  152.  
  153.         rem copy bitmap 1 to bitmap 0
  154.         copy bitmap 1,0
  155.  
  156.         rem this command will see if the bitmap has been mirror 
  157.         print "CURRENT BITMAP ",current bitmap()
  158.         print "BITMAP WIDTH ",bitmap width()
  159.         print "BITMAP HEIGHT ",bitmap height()
  160.         print "BITMAP DEPTH ",bitmap depth() 
  161.         rem this command will show the mouse pointer on screen
  162.         show mouse
  163.  
  164.     endif
  165.     
  166. loop
  167.  
  168. rem End the program
  169. end
  170.  
  171.  
  172.