Parameters
- ImageID
- GdPicture image identifier.
- Entry
- Index of the color palette. Must be a value between 0 and PaletteGetColorsCount() - 1 returned value.
Return Value
Color of the selected entry.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging()) { // Open an image file. An empty string allows the control to prompt for selecting a file. int imageID = gdpictureImaging.CreateGdPictureImageFromFile(""); if (gdpictureImaging.IsPixelFormatIndexed(imageID)) { int entriesCount = gdpictureImaging.PaletteGetColorsCount(imageID); if (entriesCount > 255) { System.Drawing.Color entryColor = gdpictureImaging.PaletteGetEntry(imageID, 130); Console.WriteLine("Color value of palette entry [130] is: {0}", entryColor.ToString()); } else Console.WriteLine("Image do not contain palette with 256 colors!"); } else Console.WriteLine("Image do not contain indexed colors!"); // Release used resources. gdpictureImaging.ReleaseGdPictureImage(imageID); }