Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.38 KB | None | 0 0
  1. for (int num_index = 0; num_index < num_of_parts; num_index++)
  2.             {
  3.                 TempList[0] = 0;
  4.                 for (y = 0; y < height; y++)
  5.                 {
  6.                     for (x = 0; x < width; x++)
  7.                     {
  8.                         if (chain_img[y, x] != 0 && chain_img[y, x] == IndexArray[num_index])
  9.                         {
  10.                             if (TempList[0] == 0)
  11.                             {
  12.                                 TempList[0] = x;
  13.                                 TempList[1] = y;
  14.                                 TempList[2] = x;
  15.                                 TempList[3] = y;
  16.                             }
  17.                             else {
  18.  
  19.                                 if (TempList[0] > x)
  20.                                 {
  21.                                     TempList[0] = x;
  22.                                     TempList[1] = y;
  23.                                 }
  24.                                 if (TempList[2] <= x)
  25.                                 {
  26.                                     TempList[2] = x;
  27.                                     TempList[3] = y;
  28.                                 }
  29.                             }                            
  30.                         }
  31.                     }
  32.                 }
  33.                 Obj_Pos.Add(TempList);
  34.             }
  35.             return Obj_Pos;
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement