ColorMatchToTarget function (wingdi.h)
The ColorMatchToTarget function enables you to preview colors as they would appear on the target device.
Syntax
BOOL ColorMatchToTarget(
HDC hdc,
HDC hdcTarget,
DWORD action
);
Parameters
hdc
Specifies the device context for previewing, generally the screen.
hdcTarget
Specifies the target device context, generally a printer.
action
A constant that can have one of the following values.
Return value
If this function succeeds, the return value is TRUE.
If this function fails, the return value is FALSE.
Remarks
ColorMatchToTarget can be used to proof the colors of a color output device on another color output device. Setting the uiAction parameter to CS_ENABLE causes all subsequent drawing commands to the DC to render colors as they would appear on the target device. If uiAction is set to CS_DISABLE, proofing is turned off. However, the current color transform is not deleted from the DC. It is just inactive.
When ColorMatchToTarget is called, the color transform for the target device is performed first, and then the transform to the preview device is applied to the results of the first transform. This is used primarily for checking gamut mapping conditions. Before using this function, you must enable WCS for both device contexts.
This function cannot be cascaded. While color mapping to the target is enabled by setting uiAction to CS_ENABLE, application changes to the color space or gamut mapping method are ignored. Those changes then take effect when color mapping to the target is disabled.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | wingdi.h |
Library | Gdi32.lib |
DLL | Gdi32.dll |