Skip to Content

What method should I use to draw a complete defined color image to memory?

Estimated Reading Time: 1 Minutes

Suppose you want to create only a cyan or magenta color separation from an image in a PDF document. PDPageMakeSeparations() will provide PostScript separations.

Datalogics offers several sample programs that demonstrate working with color separations. See CreateSeparations.

Also, within the Adobe PDF Library Java and .NET Interface, several sample programs demonstrate how to separate colors for images. See Images samples, particularly DrawSeparations and EPSSeparations.

It is also easy to separate colors with your own code. For example, if you render a page to a bit map using PDPageDrawContentsToMemory() and CMYK, this code fragment:

For (Row = 0; Row < Rows; Row++)
            For (Pixel = 0; Pixel < RowWide; Pixel++)
            {
            BitMap[(Row * RowWide * 4) + (Pixel * 4)] + 1] = 0;
            BitMap[(Row * RowWide * 4) + (Pixel * 4)] + 2] = 0;
            BitMap[(Row * RowWide * 4) + (Pixel * 4)] + 3] = BitMap[(Row * RowWide * 4) + (Pixel * 4)] + 0];
            }

Would result in a bit map that only shows the cyan colors, and shows it as black.

 

What method should I use to draw a complete defined color image to memory?
  • COMMENT