Re: [NTLK] Structure of a Bitmap when passed to C

From: Simon Bell (
Date: Fri Jul 08 2005 - 03:41:46 PDT

On 8 Jul 2005, at 4:59 am, Matthew Hudson wrote:

> Is there class information at the beginning of the bitmap object and
> if so - what is the structure of that?

Depends what you mean by 'the bitmap object'.

The structure returned by MakeBitmap is a NewtonScript frame:

        class: 'bitmap,
        bounds: <boundsrect, length 8>,
        data: <pixels, length xxx>,
        colordata: nil,
        mask: nil

The data slot is a binary object containing a PixelMap, which is
probably what you want to mess with in C. A PixelMap is a classic
QuickDraw structure, adapted slightly for Newton, and defined in
NewtQD.h (which is in one of the DDKs, but I can't remember which):

typedef struct
        Ptr baseAddr;
        short rowBytes; // pads to long
        short reserved1;
        Rect bounds;
        ULong pixMapFlags;
        Point deviceRes; // resolution of input device (0 indicates
#if defined(QD_Gray)
        UChar * grayTable; // gray tone table
} PixelMap;

For sample code, check out my Image Stationery, which deals extensively
with bitmaps, at

If you'd like to send me code snippets (probably better off-list) I
could try to help you with this.


This is the NewtonTalk list - for all inquiries
Official Newton FAQ:
WikiWikiNewt for all kinds of articles:

This archive was generated by hypermail 2.1.5 : Fri Jul 08 2005 - 08:00:02 PDT