Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!andrew.cmu.edu!mp1w+ From: mp1w+@andrew.cmu.edu (Marc Russell Pawliger) Newsgroups: comp.sys.mac Subject: How does UnpackBits work? Message-ID: Date: Fri, 29-May-87 16:01:10 EDT Article-I.D.: andrew.UUjSY6y00Vs4AKo08H Posted: Fri May 29 16:01:10 1987 Date-Received: Sat, 6-Jun-87 15:48:26 EDT Organization: Carnegie Mellon University Lines: 21 I have been trying to implement UnpackBits in c with mediocre success. As I understand it, packbits does the following: Read a byte called control control < 128? Next control+1 bytes are straight bitmap control >= 128? The next byte in the input stream is repeated 256-control times (2s complement of control times) I am able to read in a file I made that consists of straight lines of bitmap, however when I have to read a compressed file (a MacPaint file), the routine gets messed up. Any code fragments greatly appreciated. Marc Pawliger mp1w+@andrew.cmu.edu mp1w@cmuccvma.bitnet