SFML.Graphics.Image.GetPixel C# (CSharp) Method

GetPixel() public method

Get a pixel from the image
public GetPixel ( uint x, uint y ) : System.Color
x uint X coordinate of pixel in the image
y uint Y coordinate of pixel in the image
return System.Color
        public Color GetPixel(uint x, uint y)
        {
            return sfImage_getPixel(CPointer, x, y);
        }

Usage Example

示例#1
0
        /// <summary>
        /// Check if a pixel is collidable at x, y.
        /// </summary>
        /// <param name="x">The X position of the pixel to check.</param>
        /// <param name="y">The Y position of the pixel to check.</param>
        /// <returns>True if the pixel collides.</returns>
        public bool PixelAt(int x, int y)
        {
            if (x < 0 || y < 0 || x > Width || y > Height)
            {
                return(false);
            }

            if (collideImage.GetPixel((uint)x, (uint)y).A > Threshold)
            {
                return(true);
            }
            return(false);
        }
All Usage Examples Of SFML.Graphics.Image::GetPixel