QuickFont.JBitmap.GetPixel24 C# (CSharp) Method

GetPixel24() public method

public GetPixel24 ( int px, int py, byte &r, byte &g, byte &b ) : void
px int
py int
r byte
g byte
b byte
return void
        public void GetPixel24(int px, int py, out byte r, out byte g, out byte b)
        {
            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 * 3;
                    b = *addr;
                    g = *(addr + 1);
                    r = *(addr + 2);
                }
            }
            else
            {
                r = 0;
                g = 0;
                b = 0;
            }

        }