[comp.sys.mac.programmer] Strange _GetPicture head patch

u-lchoqu%peruvian.utah.edu@cs.utah.edu (Lee Choquette) (11/07/90)

In article <46338@apple.Apple.COM> Mark Dawson (marc@Apple.COM)
writes:

>    I didn't want to patch the system, but I couldn't figure out another way.
>    If someone else can, I'd really appreciate it.  My world: all of my 'PICT'
>    resources are compressed (they all exist under a different resource name).
>    I have alerts ('ALRT') that reference these pictures, so I somehow must
>    get the system to use the decompressed pictures (which are 'real' PICTs).

Why not replace the QuickDraw bottleneck StdGetPic with a routine that
uncompresses your compressed picture?  Tech Note 154, "Displaying
Large PICT Files", demostrates how you can use this bottleneck to read
a picture from a disk.  You just need to extend it so it decompresses
at the same time.  By doing this you have the additional advantage of
not needing enough memory for the entire uncompressed picture, since
when QuickDraw calls your StdGetPic replacement you only decompress as
many bytes as QuickDraw requests.

When you bring up the alert, pass a pointer to a filterProc which
installs your bottleneck in the alert's grafPort the first time your
filterProc is called.  Since the purpose of the filterProc is to
filter events, I assume (!) it gets called before the update event
gets passed to ModalDialog and it tries to draw the picture.

Disclaimer:  I haven't actually tried this, but from what I read, it
             should work.  (famous last words)
-----------------------------------------------------------
Lee Choquette          Internet: u-lchoqu@peruvian.utah.edu
(801) 581-8810         Bitnet:   choquette@utahcca
(801) 278-0826         UUCP:     utah-cs!peruvian!u-lchoqu