Unit 'agraphics' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

AttachPalExtra

Allocate and attach a palette sharing structure to a colormap

Declaration

Source position: agraphics.pas line 2435

function AttachPalExtra(

  Cm: PColorMap;

  Vp: PViewPort

):LongInt;

Arguments

Cm

  

A pointer to a color map created by GetColorMap().

Vp

  

A pointer to the viewport structure associated with the ColorMap.

Function result

0 if sucessful, else an error number. The only currently defined error number is out of memory (1).

Description

Allocates and attaches a PalExtra structure to a ColorMap. This is necessary for color palette sharing to work. The PalExtra structure will be freed by FreeColorMap(). The set of available colors will be determined by the mode and depth of the viewport.

Note:

This function is for use with custom ViewPorts and custom ColorMaps, as Intuition attaches a PalExtra to all of its Screens. If there is already a PalExtra associated with the ColorMap, then this function will do nothing.

See also

GetColorMap

  

Allocate and initialize Colormap

FreeColorMap

  

Free the ColorMap structure and return memory to free memory pool.

ObtainPen

  

Obtain a free palette entry for use by your program.

ObtainBestPenA

  

Search for the closest color match, or allocate a new one.


Documentation generated on: 2021-07-30