Re: Replace pixel color
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 May 2005 15:45:49 +0200
Draw the icons using an ImageAttributes object and a ColorMatrix that will
modify the colours.
If images are shades of gray then you can selectively filter any of the G,G
or B components to change the hue.
--
Bob Powell [MVP]
Visual C#, System.Drawing
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.
"Mark Heath" <MarkHeath@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B6608657-3DB1-4225-A257-C2041CB4261E@xxxxxxxxxxxxxxxx
>I have some PNG files containing icons that are entirely one color - a
> forground color of gray and a transparent background. I have loaded these
> into Bitmap objects that I am painting using the DrawImage command. I
> would
> like to sometimes paint the same icon, but with a different foreground
> color.
> Is there a quick and easy way of doing this using GDI in .NET?
>
> I tried using GetPixel and SetPixel but this returns an error: "SetPixel
> is
> not supported for images with indexed pixel formats"
> Also, the image Palette property contains no entres so I couldn't change
> that.
>
> If all else fails I can just make some more PNG files, but I am hoping
> there
> is a more elegant solution.
>
> thanks
> Mark
.
- Follow-Ups:
- Re: Replace pixel color
- From: Mark Heath
- Re: Replace pixel color
- References:
- Replace pixel color
- From: Mark Heath
- Replace pixel color
- Prev by Date: Replace pixel color
- Next by Date: BarCode
- Previous by thread: Replace pixel color
- Next by thread: Re: Replace pixel color
- Index(es):
Relevant Pages
|