CompuServe Messages

SwapBitsRastPortClipRect

    24-Jul-89 21:37:02
Sb: SwapBitsRastPortClipRect
Fm: Tim Coffey 72377,2617
To: ALL
I just added the fabulous SwapBitsRastPortClipRect() function to my nearly complete menuing program. The above function expects to receive a RastPort pointer and a ClipRect pointer. It does not seem to work quite right yet. Here is what I am doing: I want to render a small submenu at 'x,y' in screen 's'. The submenu is drawn in bitmap 'b'. I will implement a ClipRect 'cr' to call the function. Given that, this is what I am calling SwapBits…() with: (hybrid C code, I use Modula-2) cr->BitMap=b; cr->Bounds.MinX=x; cr->Bounds.MinY=x; cr->Bounds.MaxX=x+width; cr->Bounds.MaxY=y+height; cr->BitMap=b; … all other cr-> fields are NULL; … Then…. SwapBits…(&s->RPort,cr); The menu bitmap renders in the correct x,y position, but the image is offset some in the rectangle bounds I specified above. This offsetting causes a crash, of course. Where am I going wrong? Advice is most appreciated. Tim