Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!huma1!fry From: fry@huma1.HARVARD.EDU (David Fry) Newsgroups: comp.sys.mac Subject: Re: Delphi digest volume 3, issue 36 Message-ID: <2640@husc6.UUCP> Date: Mon, 3-Aug-87 18:15:12 EDT Article-I.D.: husc6.2640 Posted: Mon Aug 3 18:15:12 1987 Date-Received: Tue, 4-Aug-87 05:40:15 EDT Sender: news@husc6.UUCP Reply-To: fry@huma1.UUCP (David Fry) Distribution: world Organization: Harvard Math Department Lines: 52 >From: JIMH >Subject: changing pixel depth >Date: 25-JUL 01:47 Macintosh II >Does anyone know how the monitor cdev cause the desktop (or any >programs) to redraw themselve with the new screen depth? I want a fkey >to toggle between 1 and 8 bit mode. It pretty straightforward to set >the mode to whatever depth you need and when you r elaunch the finder >(return to finder you have new depth set. what is less straightforward >is to get the desktop to draw itself without a launch. best jim I've been using this method with success. It assumes a menu bar is present, but I guess you'd have to check that. menuBar = GetMenuBar(); ClearMenuBar(); bigPtr = &bigPort; OpenCPort(bigPtr); EraseRect(&bigPtr->portRect); /* this opens and erases a screen-sized port */ PenMode(patCopy); PaintRect(&bigPtr->portRect); /* this paints everything black */ CloseCPort(bigPtr); theRgn = GetGrayRgn(); /* this function is defined in the latest Lightspeed C release, but you can access the global variable GrayRgn if you don't have LSC */ PaintOne(NULL,theRgn); SetMenuBar(menuBar); DrawMenuBar(); DisposHandle(menuBar); temp = FrontWindow(); while ( temp != NULL ) { PaintOne((CWindowPeek)temp,((CWindowPeek)temp)->strucRgn); /* this fixes up all the windows */ temp = ((CWindowPeek)temp)->nextWindow; } /* we're done! */ David Fry fry@huma1.harvard.EDU Department of Mathematics fry@harvma1.bitnet Harvard University ...!harvard!huma1!fry Cambridge, MA 02138