[comp.sys.mac.programmer] Help with PixMaps and CopyBits

nf0i+@andrew.cmu.edu (Norman William Franke, III) (03/10/89)

I am trying to write a program to take part of a PICT and make a ppat from it.
So far the program loads and displays the pict, and allows a small 32 * 32
section to be selected. Then I want to display the section large, and small
then convert it into a ppat. However, I am trying to copy the small rectangle
from the pict to an off screen PixMap, which I created with the NewPixMap
function. I set it's rectangle to 0,0 32,32 and the rowBytes to 32 + $8000
for the ID.  Then I create a pointer with NewPtr(32*32) for the data, and
assign it to baseAddr. Then I try to use CopyBits, but the program dies.
I assume it's writing where it shouldn't. For a test, I made the baseAddr
the same as the screen, and left the bounds rectange the same (32 * 32 box)
but it didn't write the data all on one line, as I would expect, seeing
that rowBytes is the offset to the next row, and I made it 32. So after
numerous crashes, I'm lost. Could someone please tell me what I'm doing wrong?
And I'm using LightSpeed Pascal 2.0p1, and I have IM 1-3 and IV.

Thanks a lot
Norman Franke
nf0i+@andrew.cmu.edu