Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!usc!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.programmer Subject: Re: Sharing layers.library with intuition Message-ID: <17689@cbmvax.commodore.com> Date: 16 Jan 91 22:15:40 GMT References: <1991Jan11.001055.2055@mintaka.lcs.mit.edu> <17398@cbmvax.commodore.com> <1991Jan16.162030.7783@murdoch.acc.Virginia.EDU> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 42 In article <1991Jan16.162030.7783@murdoch.acc.Virginia.EDU> tmb@davinci.acc.Virginia.EDU (Thomas M. Breeden) writes: >Is it in the same tricky territory to attempt to add a clipping >rectangle within an Intuition window? No. It's actually fairly easy. See layers.library/InstallClipRegion(). Here's a cheap simple example, with no guarantees :-) if ( myregion = NewRegion() ) { /* myrect describes the rectangle you want to contain rendering * inside of. Use region operations to build this. */ OrRectRegion(myregion, &myrect); /* Install the region. All YOUR rendering will be constrained, * such as graphics calls, PrintIText(), DrawImage() etc. * Don't try to constrain Intuition's own rendering of borders, * gadgets, etc. They happen everywhere. */ ocr = InstallClipRegion(win->RPort->Layer, myregion); DrawImage(win->RPort, myimage, left, top); /* Remove your region */ InstallClipRegion(win->RPort->Layer, ocr); DisposeRegion(myregion); } } > - Tom Breeden > tmb@virginia.EDU -> Internet > tmb@virginia -> BITNET Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "Oh, PIN-compatible! I thought you wanted me to make it IN-compatible!"