The CMGetPS2ColorRenderingDictionary function retrieves the PostScript Level 2 color rendering dictionary for a given rendering intent from a given profile.

BOOL WINAPI CMGetPS2ColorRenderingDictionary(
  HPROFILE hProfile,   DWORD dwIntent,   LPBYTE lpBuffer,   LPDWORD lpcbSize,   LPBOOL lpbBinary);


  • hProfile
    Specifies the profile to use.

  • dwIntent
    Specifies the rendering intent. Can be one of the following values:


    For more information, see Rendering Intents.

  • lpBuffer
    Pointer to a buffer in which the color rendering dictionary is to be placed. If the pointer is NULL, the function returns the size required for this buffer in the memory location pointed to by lpcbSize.

  • lpcbSize
    Pointer to a variable specifying the size of the buffer. On return, the variable contains the number of bytes actually copied to the buffer.

  • lpbBinary
    Points to a Boolean variable. If its value is TRUE, data returned could be binary, or if FALSE, the data should be ASCII85 encoded. On return, the value pointed to by lpbBinary indicates whether the data returned actually is binary or ASCII85.

Return Values

If this function succeeds, the return value is TRUE. It also returns TRUE if it is called with lpBuffer set to NULL and the size of the required buffer is copied into lpcbSize.

If this function fails, the return value is FALSE. When this occurs, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h.


This function is optional for all CMMs.

If a CMM does not support this function, Windows uses the default CMM to create the color rendering dictionary.

If the color rendering dictionary tag is not present in the profile indicated by hProfile, the CMM creates the color rendering dictionary from the profile contents. The resulting color rendering dictionary can be used as the operand for the PostScript Level 2 setcolorrendering operator.

This function fails if the profile indicated by hProfile does not have LUT tags associated with it. For more information on LUT tags, see the ICC Profile Format Specification available at


**  Windows NT/2000/XP/Vista:** Included in Windows 2000 and later.
**  Windows 95/98/Me:** Included in Windows 98 and later.
**  Header:** Declared in Wingdi.h.
**  Library:** Use Gdi32.lib.

See Also

Basic Color Management Concepts, Functions