Share via


SetICMProfile

The SetICMProfile function sets a specified color profile as the output profile for a specified device context (DC).

BOOL WINAPI SetICMProfile(
  HDC hDC,   LPTSTR lpFileName);

Parameters

  • hDC
    Specifies a device context in which to set the color profile.
  • lpFileName
    Specifies the path name of the color profile to be set.

Return Values

If this function succeeds, the return value is TRUE.

If this function fails, the return value is FALSE.

Remarks

SetICMProfile associates a color profile with a device context. It becomes the output profile for that device context. The color profile does not have to be associated with any particular device. Device-independent profiles such as sRGB can also be used. If the color profile is not associated with a hardware device, it will be returned by GetICMProfile, but not by EnumICMProfiles.

Note that under Windows 95 or later, the PostScript device driver for printers assumes a CMYK color model. Therefore, all PostScript printers must use a CMYK color profile. Windows 2000 does not have this limitation.

SetICMProfile supports only RGB profiles in compatible DCs.

Windows 95/98/Me: SetICMProfileW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

Requirements

**  Windows NT/2000/XP/Vista:** Included in Windows 2000 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Wingdi.h.
**  Library:** Use Gdi32.lib.
**  Unicode:** Implemented as Unicode and ANSI versions on Windows 2000/XP/Vista. Also supported by Microsoft Layer for Unicode.

See Also

Basic Color Management Concepts, Functions, GetICMProfile, EnumICMProfiles