In this example we show how to use the Gamma property with a calibrated grayscale color space.
[C#]
using (Doc doc = new Doc()) {
doc.Width = 80;
doc.Rect.Inset(50, 50);
ColorSpace cs = new ColorSpace(doc.ObjectSoup, ColorSpaceType.CalGray);
((NumAtom)cs.Gamma).Real = 1.2;
doc.ColorSpace = cs.ID;
doc.Color.SetComponents(0.9); // gray
doc.AddOval(true);
doc.Save("examplecalgraycolorspace.pdf");
}
[Visual Basic]
Using doc As New Doc()
doc.Width = 80
doc.Rect.Inset(50, 50)
Dim cs As New ColorSpace(doc.ObjectSoup, ColorSpaceType.CalGray)
DirectCast(cs.Gamma, NumAtom).Real = 1.2
doc.ColorSpace = cs.ID
doc.Color.SetComponents(0.9)
' gray
doc.AddOval(True)
doc.Save("examplecalgraycolorspace.pdf")
End Using
End Sub
examplecalgraycolorspace.pdf
|