DRAWING

Work directly with grafport

Well, considering that you not only have to have to find the base address of the pixmap, but you also have to take into account how the grafport's rectangle may be offset within the pixmap rectangle, _and_ take into account whether each pixel is 1, 2, 4, 8, 16 or 24 bits wide, _and_, if pixel values are indexed, take into account how the RGB color you want is mapped to the index values...
...then the most efficient _general_ way to do it, I would think, would be just to call SETCPIXEL. _If_ you can make certain fixed assumptions about the above issues, then you can probably write a custom algorithm that's more efficient.

Rick

If you are working with a 32 bit grafport you can do it like this. I have never worked other bit depths but this may give you a starting point with those also.

A few notes:
The width of the 32 bit gWorld in pixels is evenly divideable by four even if the width of the rect that you use to create it is not.
Each pixel is represented by four bytes even though only 3 bytes are actualy used to display color.
If you have an 6 byte rgb record that stores the color value that you want to poke into your gWorld (DIM PixColor.rgbColor), then you can get the color to poke into the gWorld from it like this: