Creating a System.Drawing.Imaging.ColorPalette

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

How do I create a new System.Drawing.Imaging.ColorPalette? ColorPalette does
not have a constructor, and the Entries property is ReadOnly. How are we
supposed to specify a palette other than the default? If there were a method
to import an Array or Collection of System.Drawing.Color or something, it
would be no problem, but the way it is set up right now I pretty much feel
like it is useless. Any ideas? Thanks.
 
What do you need to do with a palette that you can't do with
System.Drawing.Imaging.ImageAttributes?
 
The correct method is to create an 8 bit per pixel image and seal the
palette from it.

See my GIF articles on my site for some assistance.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top