Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!ogicse!unicorn!n8643084 From: n8643084@unicorn.cc.wwu.edu (owings matthew) Newsgroups: comp.sys.amiga.programmer Subject: Re: Drawing images in intuition. HELP! Message-ID: <1991Jan19.211156.8016@unicorn.cc.wwu.edu> Date: 19 Jan 91 21:11:56 GMT References: <10330@pasteur.Berkeley.EDU> Distribution: usa Organization: Western Washington University, Bellingham Lines: 57 In article <10330@pasteur.Berkeley.EDU> morgan@cory.Berkeley.EDU (Alan Morgan) writes: > >#include >#include > >struct Window *NoBorder; >struct RastPort *r; > >USHORT imagepts[]={ 0xffff,0x4ffe,0x3ffc,0x1ff8, > 0x0ff0,0x17e0,0x03c0,0x03c0, > 0x03c0,0x03c3,0x07f0,0x1fc0, > 0x1ff8,0x3ffc,0x4ffe,0xffff }; > >struct Image picture = { 0,0,16,16,3,NULL,0x0001,0x0000,NULL}; > /* ^ I also tried 1 here */ > >main() >{ > ULONG flags; > SHORT x,y,w,h; > VOID OpenAll(); > int i; > > OpenAll(); /* Opens up intuition for me */ > > x=y=0; > w=640; > h=200; > flags=ACTIVATE|SMART_REFRESH|BORDERLESS; > > NoBorder = (struct Window *) > makeWindow(x,y,w,h,NULL,flags,NULL,-0x01,-0x01,NULL); > > /* Creates a window with several boring characteristics */ > > picture.ImageData=imagepts; > > r=NoBorder->RPort; > > DrawImage(r,&picture,10,10); If you are using Manx 3.6a or earlier, you will have to cast constants in workbench calls to long. Try this DrawImage ((struct RastPort *)r,(struct Image *image)&picture,10L,10L); This book assumes you are using lattice which defaults to long ints. You should also include the header file functions.h. It has all the functions declared and the types they return and this will make it easier when using assignment statements (no more ptr to int problems). Hope this helps. > > for(i=0;i<500000;i++); > > CloseWindow(NoBorder); >}