home *** CD-ROM | disk | FTP | other *** search
- /* -------------------------------------------------------------- */
- /* -- ImageDemo.c -- */
- /* -------------------------------------------------------------- */
- /* -- Author : Roger Fischlin -- */
- /* -- Copyright : Public Domain -- */
- /* -- Compiler : SAS-C V5.10a, "LC -L+Fish.o ImageDemo" -- */
- /* -------------------------------------------------------------- */
-
- /* image size (taken from SAVE Requester) */
- #define WIDTH 132
- #define HEIGHT 57
-
-
- /* includes */
- #include <intuition/intuition.h>
- #include <proto/intuition.h>
- #include <proto/exec.h>
-
-
- /* -------------------- vars -------------------------- */
-
- struct Library *IntuitionBase;
-
- struct Window *WD;
-
- struct NewWindow NW =
- {
- 20,20,WIDTH+40,HEIGHT+20,-1,-1,
- CLOSEWINDOW|NEWSIZE,
- WINDOWSIZING|WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|SMART_REFRESH|ACTIVATE,
- NULL,NULL,"Fenster 3-Image-Demo",
- NULL,NULL,WIDTH+40,HEIGHT+20,-1,-1,WBENCHSCREEN
- };
-
- extern UWORD far ImageData[]; /* label '_ImageData' */
-
- struct Image Bild =
- {
- 0,0,WIDTH,HEIGHT,2,
- NULL,3,0,NULL /* pointer will be installed later */
- };
-
- struct IntuiMessage *Msg;
-
- ULONG Class;
-
-
- /* -------------------- main -------------------------- */
-
- void main (void)
- {
- Bild.ImageData=ImageData; /* set pointer */
-
- /* open library */
- if (IntuitionBase=OpenLibrary("intuition.library",33))
- {
-
- /* open window */
- if (WD=OpenWindow(&NW))
- {
- /* draw image */
- DrawImage(WD->RPort,&Bild,WD->BorderLeft+6,WD->BorderTop+2);
- do
- {
- /* wait for message */
- (void)WaitPort(WD->UserPort);
- if (Msg=(struct IntuiMessage *)GetMsg(WD->UserPort))
- {
- /* re-draw ? */
- if ((Class=Msg->Class)==NEWSIZE)
- DrawImage(WD->RPort,&Bild,WD->BorderLeft+6,WD->BorderTop+2);
- ReplyMsg((struct Message *)Msg);
- }
- else Class=0;
-
- }
- while (Class!=CLOSEWINDOW); /* until user selects CLOSE gadget */
- CloseWindow(WD);
-
- }
- else puts("cant open window !");
-
- CloseLibrary(IntuitionBase);
- }
-
- else puts("cant open 'intuition.library' V33 !");
- }
-