Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int num_index = 0; num_index < num_of_parts; num_index++)
- {
- TempList[0] = 0;
- for (y = 0; y < height; y++)
- {
- for (x = 0; x < width; x++)
- {
- if (chain_img[y, x] != 0 && chain_img[y, x] == IndexArray[num_index])
- {
- if (TempList[0] == 0)
- {
- TempList[0] = x;
- TempList[1] = y;
- TempList[2] = x;
- TempList[3] = y;
- }
- else {
- if (TempList[0] > x)
- {
- TempList[0] = x;
- TempList[1] = y;
- }
- if (TempList[2] <= x)
- {
- TempList[2] = x;
- TempList[3] = y;
- }
- }
- }
- }
- }
- Obj_Pos.Add(TempList);
- }
- return Obj_Pos;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement