[net.micro.mac] Macpaint files from programs

ir320@sdcc6.UUCP (ir320) (11/01/85)

Does anyone out there know how to write a screen bitmap into a MacPaint
type document from program control.  I wan't my program to be able to 
save images it creates in MacPaint type files.

Any ideas?

John Antypas
UC San Diego

uucp: ...!{ucbvax,ihnp4,decvax}\
      ...!{bang,bmcg,noscvax  } >!sdcsvax!sdcc6!ir320
      ...!{sdchem,ihuxm,sdcarl}/

      ...!sdcsvax!gwsd!man!wolf!u0236879

arpa: ir320%sdcc6@sdcsvax.ARPA gwsd!man!wolf!u0236879@sdcsvax.ARPA
csnet: (Here that apple!) ir320%sdcc6@sdcsvax.ARPA@CSNET-RELAY.CSNET

Incidentally Apple, you can get to me either by saying:
     ...!dual!ucbvax!sdcsvax!sdcc6!ir320 -- or --
     "ir320%sdcc6"%sdcsvax.ARPA@CSNET-RELAY.CSNET

vishniac@wanginst.UUCP (Ephraim Vishniac) (11/04/85)

> Does anyone out there know how to write a screen bitmap into a MacPaint
> type document from program control.  I wan't my program to be able to 
> save images it creates in MacPaint type files.
> 
A MacPaint painting file is type "PNTG", creator "MPNT".  It consists
of a 512 byte header, which can be all zeroes, followed by the page
image.  The page image consists of 720 rows (ten inches worth).
A row consists of 72 bytes (576 pixels = 8 inches), compressed using
PackBits.  If you're too lazy to really use packbits, just precede
each row of data with a 71 (decimal) to indicate that 72 bytes of
uncompressed data follow.  The file will be compressed the first time
that it's re-saved from MacPaint.


-- 
Ephraim Vishniac
  [apollo, bbncca, cadmus, decvax, harvard, linus, masscomp]!wanginst!vishniac
  vishniac%Wang-Inst@Csnet-Relay