Results 1 to 5 of 5

Thread: Hard one: Change a picture's hue.

  1. #1

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    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!

  2. #2
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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.

  3. #3

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    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!

  4. #4
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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:
    1. 'In Paint event where m_Image is your bitmap object and
    2. 'matrix is the ColorMatrix object
    3. Dim imgAttributes As New Imaging.ImageAttributes
    4.  
    5. imgAttributes.SetColorMatrix(matrix)
    6.  
    7. e.Graphics.DrawImage(m_Image, e.ClipRectangle, _
    8.     e.ClipRectangle.Left, e.ClipRectangle.Top, e.ClipRectangle.Width, _
    9.     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.

  5. #5

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    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
  •  



Click Here to Expand Forum to Full Width