Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!decwrl!shelby!portia!Jessica!rick From: rick@Jessica.stanford.edu (Rick Wong) Newsgroups: comp.sys.mac.programmer Subject: Re: Graying out a PICT Message-ID: <3551@portia.Stanford.EDU> Date: 12 Jul 89 23:05:26 GMT References: <5982@hubcap.clemson.edu> Sender: USENET News System Reply-To: rick@Jessica.Stanford.EDU (Rick Wong) Organization: Stanford University Lines: 33 In article <5982@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: >How can one go about drawing a PICT resource grayed out? I tried setting the >penpattern to gray and calling drawpicture, but this doesn't work. Has anyone >done this before? I have a PICT button and i need to have some way of graying >it out when the button is inactive. > >Michael O'Rourke Because the penpats/penmodes/etc. are saved with the picture definition, setting them before calling DrawPicture has no effect. An easy way to achieve the desired effect is to gray out the image AFTER drawing it, by using the patBic penmode. For example: void DrawGrayedPict(PicHandle ph) { Rect r = (**ph).picFrame; DrawPicture(ph, &r); /* Here we go . . . */ PenMode(patBic); PenPat(gray); PaintRect(&r); } This, by the way, is the same technique used to draw grayed-out text in menu items, buttons, and so forth. Rick Wong Stanford University, Courseware Authoring Tools Project rick@jessica.stanford.edu