GetColorProfileElement

The GetColorProfileElement function copies data from a specified tagged profile element of a specified color profile into a buffer.

BOOL WINAPI GetColorProfileElement(
  HPROFILE hProfile,  TAGTYPE tag,  DWORD dwOffset,  PDWORD pcbSize,  PVOID pBuffer,  PBOOL pbReference);

Parameters

  • hProfile
    Specifies a handle to the International Color Consortium (ICC) color profile in question.
  • tag
    Identifies the tagged element from which to copy.
  • dwOffset
    Specifies the offset from the first byte of the tagged element data at which to begin copying.
  • pcbSize
    Pointer to a variable specifying the number of bytes to copy. On return, the variable contains the number of bytes actually copied.
  • pBuffer
    Pointer to a buffer into which the tagged element data is to be copied. The buffer must contain at least as many bytes as are specified by the variable pointed to by pcbSize. If the pBuffer pointer is set to NULL, the size of the entire tagged element data in bytes is returned in the memory location pointed to by pcbSize, and dwOffset is ignored. In this case, the function will return FALSE.
  • pbReference
    Points to a Boolean value that is set to TRUE if more than one tag in the color profile refers to the same data as the specified tag refers to, or FALSE if not.

Return Values

If this function succeeds, the return value is nonzero.

If this function fails, the return value is FALSE. For extended error information, call GetLastError.

Remarks

This function will fail if hProfile is not a valid International Color Consortium (ICC) profile.

If the pBuffer pointer is set to NULL, the size of the entire tagged element data in bytes is returned in the variable pointed to by pcbSize, and dwOffset is ignored.

This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP; because profile elements are implicitly associated with, and hard coded to, ICC tag types and there exist many robust XML parsing libraries.

Requirements

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

See Also

Basic Color Management Concepts, Functions