When either foreground color or background color for recoloring is specified from
an EMF semantic record, the add-in should recolor images in the add-in (for
example, metafiles or raster pictures).
EMF supports CMYK images using GDI+. Therefore, images in the EMF may be either
RGB or CMYK. If the image is a CMYK image, the add-in needs to convert the image to
the target color space.
Publisher maintains a target color space for the document. The add-in can use this
target color space by calling the IMsoDocExporterSite::HrConvertImageColorSpace
method with the image's color space.
Encapsulated Postscript (EPS) is a metafile type that supports extended color spaces.
User who embed EPS images in a Publisher document expect the color information to
be used in the fixed-format output. Inside Publisher, the EPS is converted to an EMF with
EPS-related semantic records. This EMF is then embedded in the page EMF file that the
application passes to the add-in.
To support color in EPS files, the add-in needs to do the following:
Call the IMsoDocExporterSite::SetEPSInfo method for DocExComment_EPSColor
records encountered in the EMF.
Extract the CMYK image from the DocExComment_EPSColorCMYKJPEG record in
the EMF. This record contains a binary object that is the actual CMYK JPEG file
stream. Use it to replace the RGB image specified in the subsequent call to the
StretchDIBits function.
The DocExComment_EPSColorSpotImage record provides spot color information
for the subsequent RGB image, which is always an index image. The add-in needs
to convert the spot image to the target color space.
The add-in can optionally call the IMsoDocExporterSite:: HrGetSpotRecolorInfo
method to obtain the document's target color from Publisher. Then the add-in can
recolor the subsequent RGB image by mapping colors from the palette of the RGB
image to flTintMin and flTintMax tints specified in the
DoxExComment_EPSColorSpotImage record. The luminosity for each color of the
palette is used for the mapping.
Non-Recolored Images
Color from EPS Files