C# - Copiez une Image dans un 8-bit Image Indexée

Je veux créer un 8-bit image indexée à partir d'une Image 32 bits de l'objet.

Bitmap img = new Bitmap(imgPath); //32-bit
Bitmap img8bit = new Bitmap(imgW, imgH, Format8bppIndexed); //8-bit

//copy img to img8bit -- HOW?

img8bit.Save(imgNewPath, ImageFormat.Png);

Je ne peux pas utiliser SetPixel pour la copier pixel-par-pixel étant donné que les Graphiques ne fonctionne pas avec les images indexées.

Quoi d'autre?

OriginalL'auteur Robinicks | 2009-11-19