943,678 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 3633
  • C# RSS
Nov 20th, 2008
0

Color manipulation

Expand Post »
Are there any methods in C# to adjust the hue, lightness and saturation of textures?

I have a Texture2D object in which I want to gradually change the hue of every pixel in the texture by the same amount over time. Just as if I was in Paint.NET and manually sliding the hue control slider for an image.

Is there a method I can use that gives me control over this?

I'm using the XNA development framework in Visual C# Express Edition
Last edited by Arctic Giraffe; Nov 20th, 2008 at 2:42 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Arctic Giraffe is offline Offline
3 posts
since Nov 2008
Nov 22nd, 2008
0

Re: Color manipulation

http://richnewman.wordpress.com/hslcolor-class/

perhaps that will get you started
Reputation Points: 11
Solved Threads: 9
Junior Poster in Training
vckicks is offline Offline
58 posts
since Jun 2008
Nov 24th, 2008
0

Re: Color manipulation

Perhaps it will :-)

I'll give it a go - thanks for that, looks like I can manipulate HSL values in images to my hearts content with this.

Hopefully I will be able to manipulate the pixels of images around the size of 450x450 (202500 pixels) in real time. If this turns out to be too much for my laptop I'm thinking of using 'stencil' images which lie on top of a changing image of the current hue desired - pre-loading in all my desired hues to display underneath it - since all my images are mostly black with a colorful glyph displayed on them that I want to gradually change colour over time.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Arctic Giraffe is offline Offline
3 posts
since Nov 2008
Nov 26th, 2008
0

Re: Color manipulation

Are there any methods in C# to adjust the hue, lightness and saturation of textures?

I have a Texture2D object in which I want to gradually change the hue of every pixel in the texture by the same amount over time. Just as if I was in Paint.NET and manually sliding the hue control slider for an image.

Is there a method I can use that gives me control over this?

I'm using the XNA development framework in Visual C# Express Edition
Yes first you must create a bitmap of the Textures. Please View my Snippet. I have also included other methods that you might find useful.

Hope this helps
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gbertoli3 is offline Offline
16 posts
since Sep 2008
Nov 27th, 2008
0

Re: Color manipulation

Thanks very much, very useful.
Last edited by Arctic Giraffe; Nov 27th, 2008 at 9:16 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Arctic Giraffe is offline Offline
3 posts
since Nov 2008
Nov 27th, 2008
0

Re: Color manipulation

Glad I could Help!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gbertoli3 is offline Offline
16 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Letter combinations
Next Thread in C# Forum Timeline: Making a program to save some peoples information.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC