예제 #1
0
 public int GetARGB(int x, int y)
 {
     if (x < 0 || y < 0)
     {
         return(0);
     }
     if (x >= ImageWidth || y >= ImageHeight)
     {
         return(0);
     }
     return(palette.GetARGB(y * ImageWidth + x));
 }
예제 #2
0
파일: Palette.cs 프로젝트: kael-ip/rippix
 public int GetARGB(int index)
 {
     if (index < 0 || index > Length)
     {
         return(0);
     }
     if (isCacheDirty)
     {
         if (palCache == null || palCache.Length != Length)
         {
             palCache = new int[Length];
         }
         for (int i = 0; i < Length; i++)
         {
             palCache[i] = nested.GetARGB(i);
         }
         isCacheDirty = false;
     }
     return(palCache[index]);
 }