// Create a pixel for an image with an 8bit palette.
ImGearPixel igPixelIndexed = new ImGearPixel(1, 8);
// Assign the pixel palette position 176.
igPixelIndexed[0] = 176;
// Create a 512x512 8bit indexed image.
ImGearPage igPageIndex = new ImGearRasterPage(512, 512,
new ImGearColorSpace(ImGearColorSpaceIDs.I),
new int[] { 8 }, true);
// Allocate a new palette
igPageIndex.DIB.Palette = new ImGearRGBQuad[256];
// Set the 176th palette entry to green.
igPageIndex.DIB.Palette[176].Red = 0;
igPageIndex.DIB.Palette[176].Green = 127;
igPageIndex.DIB.Palette[176].Blue = 0;
// Update the full image with this pixel.
for (int height = 0; height < igPageIndex.DIB.Height; height++)
for (int width = 0; width < igPageIndex.DIB.Width; width++)
igPageIndex.DIB.UpdatePixelFrom(width, height, igPixelIndexed);
// Create a pixel for a 32bit CMYK image.
ImGearPixel igPixelCMYK = new ImGearPixel(4, 8);
// Assign the pixel a blue color.
igPixelCMYK[0] = 255;
igPixelCMYK[1] = 255;
igPixelCMYK[2] = 0;
igPixelCMYK[3] = 127;
// Creates a 512x512 32bit CMYK image.
ImGearPage igPageCMYK = new ImGearRasterPage(512, 512,
new ImGearColorSpace(ImGearColorSpaceIDs.CMYK),
new int[] { 8, 8, 8, 8 }, true);
for (int height = 0; height < igPageCMYK.DIB.Height; height++)
for (int width = 0; width < igPageCMYK.DIB.Width; width++)
igPageCMYK.DIB.UpdatePixelFrom(width, height, igPixelCMYK);