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

Manage picture's handles


<< I konw that the first way, pict& is a normal handle. So I understand that I can/must call DEF DISPOSEH(pict&) to revome picture from memory. >>

This is true if you do not make this picture a resource (pGreplaceRes)

<< Second, the picture handle which was created using "FN GETPICTURE","PICUTE ON/OFF" or "OPENPICTURE" must be called KILL PICTURE, right? >>

No. KILL PICTURE is used for PICTURE ON/OFF and USR GETPICT. (Again, only if you do not turn them into a resource)

<< Third, the pict& may be resource handle, so I must call CALL RELEASERESOURCE(pict&) or CALL DETACHRESOURCE(pict&) and then DEF DISPOSEH(pict&). >>

No. If your resources are handled correctly you do not need to detach them or dispose of them. This is handled automatically by the resource manager.

<< This may mean that the handle which was created using "FN GETPICTURE" is not memory manager's normal handle, and not also resource handle. So special satement for dispose that style of hadle may be "KILL PICTURE". Is that right?
I want to know the differnce between GETPICTURE and GETRESOURCE. >>

GETPICTURE calls GETRESOURCE. Your example use of GETRESOURCE was not exactly correct. It should have been...

pictH& = FN GETRESOURCE(_"PICT",rID)

Let me try to restate this:
When a picture is _NOT_ a resource, you can dispose of it with KILL PICTURE When a picture _IS_ a resource, you do nothing.

If you start with a pict handle and call pGreplaceRes or ADDRESOURCE, this handle becomes a resource. Treat it as a resource.

If you start with a resource handle and call DETACHRESOURCE or HANDTOHAND, the picture becomes a regular handle. Treat it like a regular handle.

STAZ ~)~