Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!agate!mindseye!izumi From: izumi@mindseye.berkeley.edu (Izumi Ohzawa) Newsgroups: comp.sys.next Subject: Re: Caching Images for Views .... Message-ID: <1991May15.183632.22391@agate.berkeley.edu> Date: 15 May 91 18:36:32 GMT References: <1991May15.161837.27550@noose.ecn.purdue.edu> Sender: root@agate.berkeley.edu (Charlie Root) Distribution: usa Organization: /etc/organization Lines: 45 In article <1991May15.161837.27550@noose.ecn.purdue.edu> songer@orchestra.ecn.purdue.edu (Christopher M Songer) writes: >Hi, > > I'm looking to put a Postscript image in a view smaller than the >total image -- ie, I would like to be able to scroll around in it. I >looked through the concepts manual and it seemed to indicate that the >best way to do fast updates is to draw to a bitmap and then copy the >bit map into the view (no suprise there.) The on-line manual describes >a "Bitmap" object. It does not seem to be present in 2.0. > Bitmap object is obsolete. Its functionality has been expanded by NXImage object. This is what I do with NXImage and compositing, it may not be exactly what you need, but should contain most of the steps needed. .... NXRect myRect; id myImage; .... where you prepare cached bitmaps... // initialize myRect to size and location of bitmap. myImage = [[NXImage alloc] initSize:&myRect.size]; // You can do Zone allocation above if necessary. [myImage useCacheWithDepth: NX_TwoBitGrayDepth]; [myImage lockFocus]; /* focus on NXImage to work on */ .... standard drawing code into myImage [myImage unlockFocus]; .... In your compositing section, in another method... [myImage composite: NX_COPY toPoint: &myRect.origin ]; Izumi Ohzawa [ $@Bg_78^=;(J ] USMail: University of California, 360 Minor Hall, Berkeley, CA 94720 Telephone: (415) 642-6440 Fax: (415) 642-3323 Internet: izumi@violet.berkeley.edu NeXTmail: izumi@pinoko.berkeley.edu