Results 1 to 3 of 3

Thread: trim down a picture box

  1. #1

    Thread Starter
    Fanatic Member dark_shadow's Avatar
    Join Date
    Feb 2005
    Location
    Igloo
    Posts
    900

    trim down a picture box

    hi all in my program i'm thinking of making a game like the RISK board game. i though about using a picture box for the map and have each country in its own pic box. is there a way i can trim the picture box to the boarders if the country? like for example if i put a picture if canada there is still space where the oceans would be that can be clicked ( i'm trying to avoid this) any help on the matter would be appeicated thanks

  2. #2

  3. #3
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: trim down a picture box

    A picturebox is a rectangle, nothing to about that.

    What you could is find out the color of the pixel that was clicked on.
    If it is blue then it is sea, if it is green then it is Canada.

    You need two bitmaps.
    One is a big map that looks nice, this is shown to the user.
    The other is a map that looks less nice but each country has it's own unique color.
    When the user clicks on the displayed map you take the underlying color from the other map.
    Now you know which country was clicked.

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