ADC Home > Reference Library > Technical Q&As > Carbon > Graphics & Imaging >
Not Recommended Document
Important: The information in this document is Not Recommended and should not be used for new development.
Current information on this Reference Library topic can be found here:
Technical Q&A QD17
Spooling in or out of CompressPicture or CompressImage
Q: Can I use the
CompressPicture routine to spool in a
source picture from disk by overriding the QuickDraw proc
documented in Inside Macintosh Volume V, pages 88-89? I'm trying to save the
contents of an off-screen
GWorld as a compressed PICT resource. Unfortunately
there's no direct way to compress the
GWorld's pixel map to a resource.
A: We definitely don't recommend trying to spool in or out
the results of
CompressImage. We recommend doing one of the following instead:
- You can compress the
CompressImage and then call
ClosePicture using a data-unloading picture proc. The
drawback here is that you need to have a copy of the compressed image in
- If it's unacceptable to have an entire compressed image in memory, you can
consider banding along with data unloading: Call
DecompressImage on a band,
on another band, and so on. When all bands are done, call
drawback for this is that the compressed picture will have bands of image data
that won't display well dithered. This could be an issue, but the best way to
find out is to try it.
The second suggestion is probably the best idea if you want to keep your memory
footprint small. But much of the decision depends on your application.
[Sep 15 1995]