|
The following code shows how to colorize an image. It adds a
base image to the current page and converts it to grayscale. Then
it creates a new spot color space and assigns the new color space
to the image.
using var doc = new Doc();
doc.Rect.Inset(20, 20);
using var img = new XImage();
img.SetFile("../mypics/mypic.jpg");
int id = doc.AddImageObject(img, false);
id = doc.GetInfoInt(id, "XObject");
doc.SetInfo(id, "Grayscale", "");
int theCS = doc.AddColorSpaceSpot("MAGENTA", "0 100 0 0");
doc.SetInfo(id, "/ColorSpace:Ref", theCS.ToString());
doc.SetInfo(id, "/Decode", "[1 0]");
doc.Save("doccolorspace.pdf");

doccolorspace.pdf
Also see example code in: Doc AddColorSpaceFile
Function, Doc
AddColorSpaceSpot Function, XColor Components
Property, ColorSpace
Gamma Property, ColorSpace
WhitePoint Property.
|
|
|