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)); }
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]); }