Alexandria.Raster.GetPixel C# (CSharp) Méthode

GetPixel() public méthode

Get the index at a position, or return the default value if the position is out of range.
public GetPixel ( Vector2i position, int defaultValue ) : int
position Vector2i
defaultValue int The default value to return if th position is out of range.
Résultat int
        public int GetPixel(Vector2i position, int defaultValue = 0)
        {
            if (Contains(position))
                return data[position.X + position.Y * Stride];
            return defaultValue;
        }