Results 1 to 3 of 3

Thread: Recolor Image

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Adelaide - Australia
    Posts
    150

    Recolor Image

    I am building a replacement for the TabStrip control, and am having trouble drawing my images to a custom color.
    My control looks something like this where the tabs are down the left hand side.
    _____
    {_ |
    { | |
    { | |
    |____|
    These tabs are black and white images and I would like to be able to recolor these to a custom color.

    I know it is simple but I cant get it to recolor the image and make the background of the image transparent. Can anyone please tell me how to do this??

    Thanks

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Adelaide - Australia
    Posts
    150
    my image didn't really work
    ._______
    {_..........|
    {_|.........|
    {_|.........|
    ...|.........|
    ...|_____|

    Just ignore all of the .'s

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You can convert to the HSB colour scheme, then increase the saturation to 100%, and change the hue to a random number. Then you can convert it back to RGB.

    Another way would be to have R, G, and B values (decimals) that you multiply by what they have, and that gives you a new colour. Eg.
    VB Code:
    1. Function Colour(R As Long, G As Long, B As Long, cR As Single, cG As Single, cB As Single)
    2.     R = Round(R * cR)
    3.     G = Round(G * cR)
    4.     B = Round(B * cR)
    5. End Function
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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