473,378 Members | 1,504 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,378 software developers and data experts.

Setting the Color Pallette in an Indexed bitmap

I want to put my own custom colors in the Pallete.....could someone tell
me how to do this?. I tried the following:
bitmap.Palette.Entries.SetValue(Color.White,0);
This was supposed to set the color in the first position in the pallette
but it doesn't......how do i do this?.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 8084
Check out the article in the GDI+ FAQ that explains how to modify the
transparent colour in a GIF image. The technique used to replace the colour
palette in that article can be used on any indexed image format.

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

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"James Dean" <m_*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I want to put my own custom colors in the Pallete.....could someone tell
me how to do this?. I tried the following:
bitmap.Palette.Entries.SetValue(Color.White,0);
This was supposed to set the color in the first position in the pallette
but it doesn't......how do i do this?.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

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

Similar topics

1
by: James Dean | last post by:
I get the following message when i try to set a pixel in the bitmap.......whats wrong and how can i fix it....... "Additional information: SetPixel is not supported for images with indexed pixel...
0
by: James Dean | last post by:
I have heard that you can change your indexed pallette as your drawing your bitmap......if you can how do you do this.... *** Sent via Developersdex http://www.developersdex.com *** Don't just...
1
by: jty202 | last post by:
I know alot of people have the problem with indexed pixel format. I hope someone can show me the solution to this.I am have problem with graphics with the following code giving the error: "A...
2
by: sympatico | last post by:
im trying to read an image(*.bmp) from file and then color the black pixels in it to the color i want using argb. Below is the code of what im trying to do but this gives me an error "setPixel is...
3
by: ShihChengYu | last post by:
Dear all: How to convert color image to bi-level image? I have confronted one problem when I build my OCR project. I used an software API function to enhance my project, but the API only...
0
by: xhy_China | last post by:
Hi,I want to ask three questions(in vs.net and C#): 1. how can I know whether a bitmap is an indexed or non-indexed? 2. how can I convert a indexed bitmap to non-indexed bitmap? 3. how can I...
8
by: Joergen Bech | last post by:
Suppose I have Dim bm As New Bitmap(16, 16,Imaging.PixelFormat.Format8bppIndexed) I cannot use Dim g As Graphics = Graphics.FromImage(bmdest) Dim hdc As IntPtr = g.GetHdc() as the...
1
by: Nathan Sokalski | last post by:
I have created declared a Bitmap using the following statement: Dim bmp As New Bitmap(100, 100, PixelFormat.Format8bppIndexed) Because the SetPixel() method is disabled and a Graphics object...
5
by: macap.usenet | last post by:
Hello, I am creating Gif-Images (8bit: 256 colors) with using the IHttpHandler and .ashx-Files. My ProcessRequest-Method looks like this: public void ProcessRequest(HttpContext context) {
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.