lozina
Lifer
I am not a graphics programmer so I have no idea what terms to use to search for this... but it should be a pretty common algorithm.
I have a bitmap image which has several irregular shaped areas of solid color. Imagine a map of the united states where each state was filled in with a solid unique color. I need to scan such an image and create polygons out of the states.
The ultimate goal is that the program will have a bunch of polygons (or just arrays of vertexes?) which represent each state in the map, so If I display that map on a screen and the user clicks on the map I can figure out what state the user clicked on by testing in which polygon the mouse coordinates fall.
I know there is an easier way to do this, by dynamically getting the pixel at the coordinate and then looking up the pixel's color against a table to match the country but I can't do this for reasons I'll only confuse you with.
I have a bitmap image which has several irregular shaped areas of solid color. Imagine a map of the united states where each state was filled in with a solid unique color. I need to scan such an image and create polygons out of the states.
The ultimate goal is that the program will have a bunch of polygons (or just arrays of vertexes?) which represent each state in the map, so If I display that map on a screen and the user clicks on the map I can figure out what state the user clicked on by testing in which polygon the mouse coordinates fall.
I know there is an easier way to do this, by dynamically getting the pixel at the coordinate and then looking up the pixel's color against a table to match the country but I can't do this for reasons I'll only confuse you with.