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

Understand picture recording


The only way to get a handle to a new PICT that you're creating is to do this:

1. Turn on picture recording (it will apply to whatever graphics port is current, whether that be a window or a gWorld);
2. Execute some graphics commands;
3. Turn off picture recording.

After you've done Step 3, your handle is ready. You can use either the PICTURE function or the PICTURE OFF statement to retrieve the handle.

Now let's talk about Step 2. Picture recording will record any QuickDraw command (except commands that draw icons). That includes commands like DrawPicture, so you can record a previously-created picture inside the new one you're creating. Any new stuff you draw on top of that will also get recorded.

If you want to just get a "snapshot" of the completed drawing, without recording the individual drawing commands--well, you still have to follow the "3-step" method, but you can do it like this:

0. Draw the whole picture to the GWorld;
1. Turn on picture recording;
2. Execute a "CopyBits" command;
3. Turn off picture recording.

Since "CopyBits" is just another QuickDraw command, it gets recorded; and the entire pixel map gets included in the recording.

There are pro's & con's to doing it the "CopyBits" way as opposed to the "simple" (non-copybits) way. Perhaps the best argument for the "simple" method is that it doesn't require a GWorld at all. If all you're interested in doing is generating a new picture from old & new "parts," then any old graphics port will do--I usually just "record" into whatever my current window is (the recorded bits by default don't show up in the window). The only caveat is that you may have to temporarily fiddle with the window's clip region (the recorded picture is always limited to the clip region (not to the window's rectangle!))

Other advantages to the "simple" method:
* It tends to scale better if you need to display it at a different size (but text may scale funny);
* It tends to take better advantage of your printer's higher resolution when you print it;
* For simple drawings, it tends to occupy less disk storage, and may even display faster.
* CopyBits records _everything_ that's in the specified rectangle; including residual stuff that you may not want included in your picture.

Advantages to the "CopyBits" method:
* For complex drawings, it will almost certainly display faster;
* You can do interesting color mixing effects with GWorlds.

Rick