SetColorProfileElement function (icm.h)

Sets the element data for a tagged profile element in an ICC color profile.

Syntax

BOOL SetColorProfileElement(
  HPROFILE hProfile,
  TAGTYPE  tag,
  DWORD    dwOffset,
  PDWORD   pcbElement,
  PVOID    pElement
);

Parameters

hProfile

Specifies a handle to the ICC profile in question.

tag

Identifies the tagged element.

dwOffset

Specifies the offset from the first byte of the tagged element data at which to start writing.

pcbElement

Pointer to a variable containing the number of bytes of data to write. On return, it contains the number of bytes actually written.

pElement

Pointer to a buffer containing the data to write to the tagged element in the color profile.

Return value

If this function succeeds, the return value is TRUE.

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 ICC profile.

If the color profile is not opened for read/write permission, this function fails.

If dwOffset exceeds the size set for the specified tagged element, this function fails.

If dwOffset + *pcbSize is greater than the size of the specified element, this function only writes as many bytes as will fit within the current size of the element.

Any existing data in the specified portion of the tagged element is overwritten when this function succeeds.

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

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header icm.h
Library Mscms.lib
DLL Mscms.dll

See also