Xref: utzoo comp.sys.amiga:19812 comp.sys.amiga.tech:925 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!boulder!cu-den!udenva!isis!csm9a!ngorelic From: ngorelic@csm9a.UUCP (Noel Gorelick) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Image in a window Keywords: Simple, no-prob, ACK!, doesn't work Message-ID: <740@csm9a.UUCP> Date: 10 Jun 88 10:32:00 GMT Organization: Big Blue Box Lines: 94 I'm trying to display an image in a window in a screen. Simple, No? I have opened the screen with depth=5, and opened the window without any problems. My image is a dpaint brush (the moon from DpaintI), and was made with Brush2C, and is included as a .h file. So when I tell it to DisplayImage(r,&picture,0,0), how come all I get is a blank window? Am I missing some fundamental thinggy, or what? Here's the code: It's short, but the image file was too long to include. /* */ ---- source "prog.c"----- #include #include #include struct Image picture = { 0,0, /* LeftEdge, TopEdge */ 53,47,5, /* Width, Height, Depth */ &pictureData[0], 31,0, /* PlanePick, PlaneOnOff */ NULL, /* Pointer to next Image */ }; struct IntuitionBase *IntuitionBase; struct RastPort *r; struct NewScreen SS1 = { 0,0,640,200,3, /* LEdge,TEdge,Width,Height,Depth */ 1,2, /* DetailPen,BlockPen */ NULL, /* ViewModes */ CUSTOMSCREEN, /* Type */ NULL, /* *Font */ "Screen", /* Title */ NULL,NULL /* Gadgets,CustomBitMap */ }; struct NewWindow WW1 = { 0,0,640,200, /* LEdge,TEdge,Width,Height */ -1,-1, /* DetailPen,BlockPen */ NULL, /* IDCMP */ ACTIVATE|SMART_REFRESH|BORDERLESS|GIMMEZEROZERO, NULL,NULL, /* FirstGadget,CheckMark */ NULL, /* Title */ NULL, /* Screen <- fill this in when we make it */ NULL, /* BitMap */ 0,0,0,0, /* MinW,MinH,MaxW,MaxH <- Defaults to W,H */ CUSTOMSCREEN /* Type */ }; struct Window *W1; struct Screen *S1; #define I_REV 33 main() { VOID delay_f(); if(!(IntuitionBase=(struct IntuitionBase *) OpenLibrary("intuition.library",I_REV))) { printf("cant open intbase"); exit(); } /* open screen and window */ S1 = (struct Screen *)(OpenScreen(&SS1)); WW1.Screen = S1; W1=(struct Window *)(OpenWindow(&WW1)); r=W1->RPort; DrawImage(r,&picture,0,0); CloseWindow(W1); CloseScreen(S1); } /* -------- moon.h ---------- */ USHORT pictureData[] = { 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0400,0x0000,0x0000, ... you get the idea ... } ---------------------------------------------------------------- "You want it should sing too?" | ngorelic@csm9a ...isis!csm9a!ngorelic "Dis-Claimer Dat-Claimer, to look at | hpuecoa!bgphp1!ngorelic at 'em, you'd never know the diff." | deutero!bgphp1!ngorelic