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.
Printable View
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.
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?
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...
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)
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.