|
-
Jan 22nd, 2005, 06:01 PM
#1
Thread Starter
Fanatic Member
Hard one: Change a picture's hue.
Exactly what it says in the title.
Is it possible to change picture's hue in VB.NET?
Like you'd do with your image editor.
I don't seem to be able to find any info about this kind of thing...
Thanks a lot.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Jan 22nd, 2005, 06:07 PM
#2
Fanatic Member
Re: Hard one: Change a picture's hue.
I'm not an expert but when I first got my copy of VB.NET I explored its graphics capabilities and it didn't seem like that was possible. Sounds horrible, but if you could get the handle to the underlying picture and pass it to some C++ code I bet that could do it real fast?
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Jan 22nd, 2005, 06:14 PM
#3
Thread Starter
Fanatic Member
Re: Hard one: Change a picture's hue.
Sorry, but no knowledge of C++ here. 
I'm sort of looking for a control/class/function/module that can do this. Maybe someone knows about one, 'cause I can't find anything...
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Jan 22nd, 2005, 09:30 PM
#4
Fanatic Member
Re: Hard one: Change a picture's hue.
Found this, it's in VC++7 but uses GDI+. http://www.codeguru.com/Cpp/G-M/gdi/...cle.php/c3667/
Also, the code had a comment pointing to this website that explains hue shifting which isn't nearly as easy as other manipulations. http://www.sgi.com/grafica/matrix/
.NET has a ColorMatrix class, but it doesn't look like this guy is using that same class. If you can figure out how to setup a ColorMatrix object, this code should draw an image:
VB Code:
'In Paint event where m_Image is your bitmap object and
'matrix is the ColorMatrix object
Dim imgAttributes As New Imaging.ImageAttributes
imgAttributes.SetColorMatrix(matrix)
e.Graphics.DrawImage(m_Image, e.ClipRectangle, _
e.ClipRectangle.Left, e.ClipRectangle.Top, e.ClipRectangle.Width, _
e.ClipRectangle.Height, GraphicsUnit.Pixel, imgAttributes)
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Jan 23rd, 2005, 07:59 AM
#5
Thread Starter
Fanatic Member
Re: Hard one: Change a picture's hue.
I have found a piece of code on PSC that does the trick. It uses a dll called FoxCBmp in combination with a module. It works quite easy and very fast.
Here's the program: http://www.planet-source-code.com/vb...21470&lngWId=1
The only bad part is, it's for VB6.0 not for .NET, but I think I'll be able to make it works for .NET. If I do so I'll post the .NET version here too.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|