473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Creating a System.Drawing.Imaging.ColorPalette

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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 2 '08 #1
2 4531
What do you need to do with a palette that you can't do with
System.Drawing.Imaging.ImageAttributes?

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 2 '08 #2
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.

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving,...
1
by: Ira | last post by:
I was successful in creating the multipage Tif files in VB.net using the following the following code: Public Sub SaveSeveralOnePageFilesInADir(ByVal DrNm As String, ByVal resultFl As String)...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
9
by: colin | last post by:
Hi, I have all the components of a .bmp file in memory wich i need to write to a .bmp file, (or other convenient image file) ie i have 256 color pallete of RGBquads and array of 8bit pixels, I...
10
by: Nathan Sokalski | last post by:
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.