home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / AmigaTalk / testfiles / TestBitMaps < prev    next >
Encoding:
Text File  |  2004-01-31  |  1.2 KB  |  59 lines

  1. scr <- Screen new: 16r40D20001
  2. scr          open: 'Testing Screen'
  3.  
  4. win <- Window new: 'TestBitMaps Window'
  5.  
  6. win setFlags:       16r1100F
  7. win setIDCMPFlags:  16r240     "IDCMP_CLOSEWINDOW + IDCMP_GADGETUP"
  8. win openOnScreen:   scr
  9.  
  10. itxt <- IText new: 'Press Close Gadget when you are done!'  
  11.  
  12. itxt setPens:        6 @ 1
  13. itxt setITextOrigin: 0 @ 0
  14. itxt setDrawMode:    0       "JAM1 = 0"
  15. itxt registerTo:     win
  16. itxt setDrawMode:    0
  17.  
  18. win  printIText:  itxt at: 100 @ 390
  19.  
  20. bmap <- BitMap new
  21.  
  22. bmap grabScreenPiece: 'T:screenGrab' x: 0 y: 0 w: 320 h: 500
  23.  
  24. bmap setBitMapWidth: 200
  25. bmap setBitMapHeight: 90
  26. bmap setBitMapDepth:   8
  27. bmap setBitMapFlags:  14 
  28. bmap makeBitMap
  29.  
  30. bmap readBitMapFile:  'T:screenGrab'
  31.  
  32. bmap changeBitMapDepth: 4 "chop off 4 planes!"
  33.  
  34. bmap writeBitMapFile: 'T:writeBMapCheck'
  35.  
  36. chkscr <- Screen new: 16r40D20001
  37.  
  38. chkscr setBitMap: bmap
  39.  
  40. chkscr open: 'Hacked-up BitMap screen!'
  41.  
  42. " ---------------------------------------------
  43.   Later:  
  44.     bmap readBitMapFile: 'T:writeBMapCheck'
  45.     bmap displayBitMap
  46.   ---------------------------------------------
  47. "
  48.  
  49. rval <- win handleIntuition     "Wait for the Close Gadget"
  50.  
  51. chkscr close
  52.  
  53. bmap   remove
  54.  
  55. itxt dispose
  56.  
  57. win  close
  58. scr  close
  59.