FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DRAWING

Copy non rectangle frame from a GWorld


Hi, I need some help. I'm trying to copy a picture from one Gworld to another but I have a problem. The picture isn't a perfect rectangle...and when I try to copy the picture to the other GWorld, it pastes the whole rectangle that I copied. Is there any way to copy just the picture? Thanks.

John

I think setting
PEN ,,,_srcOr
before COPYBITS will do what you need, I think.
Al

You could try using COPYMASK, but then you have to have a mask, which is a bitmap version of your graphic, black regions will copy and white regions will not. Just like an ICON.
CALL COPYMASK(#sourceGWorld&+2,#sourceMaskGWorld&+2,#destinationGWorld&+2,sourceRect, 
              sourcemaskRect,dstinationRect)
Or you can look into changing the copy mode for COPYBITS, this is the last parameter you set in CALL COPYBITS.

If you set that to 36 (transparent, I'm unsure of the constant name), all regions that are the same as the background color will be transparent.

For more info on the copymodes setting take a look at
http://developer.apple.com/techpubs/quicktime/qtdevdocs/INMAC/MACWIN/imClrQuickDraw.a.htm
Stephen Botting

What's in the part of the rectangle that _doesn't_ have the picture in it?

Just white space? If so, you've got two options. One, as already suggested, is a mask region. The other is:
CALL COPYBITS(#sourceport&+2,#destport&+2,myrect,newrect,_transparent,0)
When I do stuff with gWorlds, my first step is always to "white out" the background with a simple
CALL FORECOLOR(_whiteColor)
CALL PAINTRECT(wholeRect) 'wholeRect being the whole drawing area
CALL FORECOLOR(_blackColor)
... so you don't get those flurorescent effects you see when copying from a part of a gWorld that doesn't have stuff in it.
Lucy