QuickFont.JBitmap.GetPixel C# (CSharp) Method

GetPixel() public method

public GetPixel ( int px, int py ) : byte
px int
py int
return byte
        public byte GetPixel(int px, int py)
        {

            py = bitmapData.Height - py;

            if (px >= 0 && py >= 0 && px < bitmapData.Width && py < bitmapData.Height)
            {
                unsafe
                {
                    byte* addr = (byte*)(bitmapData.Scan0);
                    addr += bitmapData.Stride * py + px;
                    return *addr;

                }
            }
            else
            {
                return 0;
            }
        }