home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / binaries / image.lha / compleximage.e < prev    next >
Text File  |  1992-09-02  |  3KB  |  87 lines

  1. /*   compleximage.e  translated from the RKRM libraries examples
  2.      Translated by Eric Stringer    INTERNET #"NES@delphi.com"
  3.      This program puts a two bitplane image of a box in a window.
  4. */
  5.  
  6.  
  7. MODULE 'exec/types','intuition/intuition','intuition/intuitionbase'
  8.  
  9. CONST MYIMAGE_LEFT = 0
  10. CONST MYIMAGE_TOP  = 0
  11. CONST MYIMAGE_WIDTH = 24
  12. CONST MYIMAGE_HEIGHT = 10
  13. CONST MYIMAGE_DEPTH  = 1
  14. CONST BUFSIZE=GADGETSIZE*3, IFLAGS=IDCMP_CLOSEWINDOW+IDCMP_GADGETUP
  15. DEF buf[BUFSIZE]:ARRAY, w
  16.  
  17.  
  18.  
  19. PROC main()
  20.  
  21. DEF win:PTR TO window, myimage:PTR TO image, myimagedata:PTR TO LONG,t:PTR TO INT
  22.  
  23.  
  24. myimagedata:= [$FFFF,$FF00,    /* Image data plane 1 */
  25.                $C000,$0300,
  26.                $C000,$0300,
  27.                $C000,$0300,
  28.                $C000,$0300,
  29.                $C000,$0300,
  30.                $C000,$0300,
  31.                $C000,$0300,
  32.                $C000,$0300,
  33.                $FFFF,$FF00,
  34.  
  35.                $0000,$0000,    /* Image data plane 2 */
  36.                $0000,$0000,
  37.                $0000,$0000,
  38.                $00FF,$0000,
  39.                $00FF,$0000,
  40.                $00FF,$0000,
  41.                $00FF,$0000,
  42.                $0000,$0000,
  43.                $0000,$0000,
  44.                $0000,$0000]:INT
  45.  
  46. intuitionbase:=OpenLibrary('intuition.library',37)
  47.  
  48. IF (intuitionbase <> NIL)
  49.    IF (NIL <> (win:=OpenW(20,11,400,100,IFLAGS,$f,'SimpleImage',NIL,1,buf)))
  50.  
  51.  
  52. myimage := [ MYIMAGE_LEFT,   /* leftedge offset */
  53.              MYIMAGE_TOP,    /* topedge offset  */
  54.              MYIMAGE_WIDTH,  /* width of image  */
  55.              MYIMAGE_HEIGHT, /* height of image */
  56.              MYIMAGE_DEPTH,  /* number of bitplanes */
  57.              myimagedata,    /* image data          */
  58.              $3,             /* plane on which data is to be put */
  59.              $0,             /* Set or clear other planes   */
  60.              NIL ]:image
  61.  
  62.        /* Draw Image on first bit plane  */
  63.        DrawImage(win.rport, myimage,20,50)
  64.        TextF(10,75,'First & second bit plane')
  65.  
  66. myimage := [ MYIMAGE_LEFT,   /* leftedge offset */
  67.              MYIMAGE_TOP,    /* topedge offset  */
  68.              MYIMAGE_WIDTH,  /* width of image  */
  69.              MYIMAGE_HEIGHT, /* height of image */
  70.              MYIMAGE_DEPTH,  /* number of bitplanes */
  71.              myimagedata,    /* image data          */
  72.              %1010,
  73.              $0,
  74.              NIL ]:image
  75.        /* draw Image on second plane */
  76.        DrawImage(win.rport, myimage,80,50)
  77.  
  78.        Delay (200)
  79.  
  80.        CloseW(win)
  81.     ENDIF
  82. CloseLibrary(intuitionbase)
  83. ENDIF
  84. ENDPROC
  85.  
  86.  
  87.