PackageDescription: PNGImageWriter


PNG Image Writer

Last published: June 3, 2014 by 'stevek'

Defines 3 Classes
Extends 3 Classes


This package contains a PNG image writer. It can convert an Image (or anything that understands #asImage) or an OpaqueImage into a stream of characters that represent a PNG file.

Usage
To use this, you will need to load either the Compression-ZLibWrite package, the Compression parcel (from the goodies parcels directory) or the ZLibInterface parcel.

To compress an image, use: "PNGImageWriter writeImage: anImage on: aStream".

For example, to compress the contents of your screen:

| stream |
stream := 'screen.png' asFilename writeStream.
[stream binary.
Refactory.PNG.PNGImageWriter
writeImage: (Screen default completeContentsOfArea: Screen default bounds)
on: stream]
ensure: [stream close]