|
-
Aug 19th, 2006, 10:22 AM
#1
Thread Starter
Fanatic Member
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
-
Aug 19th, 2006, 10:45 AM
#2
Re: trim down a picture box
Check out this thread. There are many others - just search for "transparent picturebox".
-
Aug 19th, 2006, 10:51 AM
#3
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|