Results 1 to 4 of 4

Thread: filling in a color on an image

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    Hi.
    I don't really know how to ask this, so I'll just explain my objective instead.

    I want to be able to have an image, best example would be a map of the United States. Then depending on certain circumstances, the states would each be colored a different color, for example a climate map where hotter states are red and cooler ones are blue. Then if I click another button, the map will be changed to a new set of colors, for example high population states will be green, and low ones will be yellow.
    You see what I mean right?
    So the question is, how do I do that?
    Should I start with a scanned in image of the US that is plain white with black State borders. And if I do that, then how do I tell VB to fill the color of one state and to stop coloring at the border.

    Maybe another way to say it is: how could I write an application that functions similar to a coloring book, coloring in irregular areas of an image?

    If you have the answers, or just some helpful hints, please reply. Thanks

    Wengang
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    California
    Posts
    154
    Try looking up the FloodFill api.
    VB-World addict!

    All spelling errors are undocumented words!
    http://www.bells.f2s.com

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You could try an inverted mask for each of the states. An INVERTED mask is when the area you want coloured is white and the rest is black. After that you can specify a backcolor for the picbox and then blit that onto the main picture box.... Since I know the search function is disabled, you can look up how to do this here: (the link is broken as of yet but it will be fixed)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Last edited by Sastraxi; Mar 16th, 2001 at 09:47 AM.
    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