CMCreateTransform

[This is preliminary documentation and subject to change.]

The CMCreateTransform ANSI function creates a color transform that maps from an input LOGCOLORSPACE to an optional target space and then to an output device.

HCMTRANSFORM WINAPI CMCreateTransform(
  LPLOGCOLORSPACEA lpColorSpace,       // color space pointer
  LPDEVCHARACTER lpDevCharacter,       // profile file name
  LPDEVCHARACTER lpTargetDevCharacter  // target profile file name
);
 

Parameters

lpColorSpace
Pointer to an input logical color space structure.
lpDevCharacter
Pointer to a memory-mapped device profile. For 16-bit device drivers that are ICM aware, lpDevCharacter points to the profile file name.
lpTargetDevCharacter
Points to a memory-mapped target profile.

Return Values

If this function succeeds, the return value is a color transform in the range 256 to 65,535. Since only the low WORD of the transform is retained, valid transforms cannot exceed this range.

If this function fails, the return value is an error code having a value less than 256. When the return value is less than 256, signaling an error, the CMM should use SetLastError to set the last error to a valid error value as defined in Winerror.h.

Remarks

The Unicode equivalent of the CMCreateTransform function is CMCreateTransformW.

Every CMM is required to export this function.

The forward transform must be already computed before calling CMCreateTransform. Future calls to the translate functions (CMTranslateColors, CMTranslateRGB, CMTranslateRGBs, and CMTranslateRGBsExt) using the forward transform should not fail due to inability to construct the mapping.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.

See Also

Color Management Overview, ICM 2.0 Functions, CMCreateTransformW, CMTranslateColors, CMTranslateRGB, CMTranslateRGBs, CMTranslateRGBsExt