Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 9b3ef98d82282343cfac7f840aa5ab34 > files > 287

PyX-0.11.1-1.fc15.i686.rpm

Store bitmap data using PyX

While the main purpose of PyX is to create vector graphics, it is also possible
to store bitmap data in the PyX output. In this example, we show how to
create a simple data structure containing the bitmap data ... and how such data
can then be transformed into an object which can be inserted into a PyX canvas.

The first step of providing the bitmap data is creating an `image` instance.
You need to specify the size of your data (in pixels) followed by strings
describing the type of the bitmap and the bitmap data itself.

! The bitmap functionality currently uses a fixed color depth of 8 bits per
color. The pixels are listed row by row, one after the other starting at the
upper left corner of the image.

Once the image data has been prepared, a `bitmap` instance can be created and
inserted into a PyX canvas for later output.