CreateColorTransform

[This is preliminary documentation and subject to change.]

The CreateColorTransform function creates a color transform that applications can use to perform color management.

HTRANSFORM WINAPI CreateColorTransform(
  LPLOGCOLORSPACE pLogColorSpace,
  HPROFILE hDestProfile,
  HPROFILE hTargetProfile,
  DWORD dwFlags
);
 

Parameters

pLogColorSpace
Pointer to the input LOGCOLORSPACE.
hDestProfile
Handle to the profile of the destination device.
hTargetProfile
Handle to the profile of the target device.
dwFlags
The high-order WORD of dwFlags should be set to ENABLE_GAMUT_CHECKING if this transform will be used for gamut checking.

The low-order WORD can have one of the following constant values: PROOF_MODE, NORMAL_MODE, BEST_MODE. Moving from PROOF_MODE to BEST_MODE, output quality generally improves and transform speed declines.

Return Values

If this function succeeds, the return value is a handle to the color transform.

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

Remarks

If the target profile is NULL, the transform goes from the source logical color space to the destination profile. If the target profile is given, the transform goes from the source logical color space to the target profile and then to the destination profile. This allows previewing output meant for the target device on the destination device.

The values in dwFlags are intended as hints only. The color management module must determine the best way to use them.

The CreateColorTransform function is used outside of a DC. Colors may shift when transforming from a color profile to the same color profile. This is due to precision errors. Therefore, a color transform should not be performed under these circumstances.

The B2Ax tags are required for any profile that is the target of a transform.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in icm.h.
  Import Library: Use mscms.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Color Management Overview, ICM 2.0 Functions