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 >
Wrap
Text File
|
1992-09-02
|
3KB
|
87 lines
/* compleximage.e translated from the RKRM libraries examples
Translated by Eric Stringer INTERNET #"NES@delphi.com"
This program puts a two bitplane image of a box in a window.
*/
MODULE 'exec/types','intuition/intuition','intuition/intuitionbase'
CONST MYIMAGE_LEFT = 0
CONST MYIMAGE_TOP = 0
CONST MYIMAGE_WIDTH = 24
CONST MYIMAGE_HEIGHT = 10
CONST MYIMAGE_DEPTH = 1
CONST BUFSIZE=GADGETSIZE*3, IFLAGS=IDCMP_CLOSEWINDOW+IDCMP_GADGETUP
DEF buf[BUFSIZE]:ARRAY, w
PROC main()
DEF win:PTR TO window, myimage:PTR TO image, myimagedata:PTR TO LONG,t:PTR TO INT
myimagedata:= [$FFFF,$FF00, /* Image data plane 1 */
$C000,$0300,
$C000,$0300,
$C000,$0300,
$C000,$0300,
$C000,$0300,
$C000,$0300,
$C000,$0300,
$C000,$0300,
$FFFF,$FF00,
$0000,$0000, /* Image data plane 2 */
$0000,$0000,
$0000,$0000,
$00FF,$0000,
$00FF,$0000,
$00FF,$0000,
$00FF,$0000,
$0000,$0000,
$0000,$0000,
$0000,$0000]:INT
intuitionbase:=OpenLibrary('intuition.library',37)
IF (intuitionbase <> NIL)
IF (NIL <> (win:=OpenW(20,11,400,100,IFLAGS,$f,'SimpleImage',NIL,1,buf)))
myimage := [ MYIMAGE_LEFT, /* leftedge offset */
MYIMAGE_TOP, /* topedge offset */
MYIMAGE_WIDTH, /* width of image */
MYIMAGE_HEIGHT, /* height of image */
MYIMAGE_DEPTH, /* number of bitplanes */
myimagedata, /* image data */
$3, /* plane on which data is to be put */
$0, /* Set or clear other planes */
NIL ]:image
/* Draw Image on first bit plane */
DrawImage(win.rport, myimage,20,50)
TextF(10,75,'First & second bit plane')
myimage := [ MYIMAGE_LEFT, /* leftedge offset */
MYIMAGE_TOP, /* topedge offset */
MYIMAGE_WIDTH, /* width of image */
MYIMAGE_HEIGHT, /* height of image */
MYIMAGE_DEPTH, /* number of bitplanes */
myimagedata, /* image data */
%1010,
$0,
NIL ]:image
/* draw Image on second plane */
DrawImage(win.rport, myimage,80,50)
Delay (200)
CloseW(win)
ENDIF
CloseLibrary(intuitionbase)
ENDIF
ENDPROC