Byte[] array to image

I’ve created a byte array similar to this and I’m trying to display that as an image in SDL2C#.

I’m kind of lost with struggling to understand which functions I should be using to do this, it also appears that SDL2C# doesn’t have all the functions that some of the things I’ve read mention, ie: SDL_LoadBMP_RW does not appear to be available.

I want to avoid saving it to a file then reading it from said file.

Never mind, I think I figured it:

IntPtr pxls;
unsafe
{
    fixed (byte* ptr = _rawComponentImage)
    {
        pxls = new IntPtr(ptr);
    }
}
IntPtr sdlSurface = SDL.SDL_CreateRGBSurfaceFrom(pxls, _w, _h, 32, _w * 32, 0, 0, 0, 0);
IntPtr sdltexture = SDL.SDL_CreateTextureFromSurface(_state.rendererPtr, sdlSurface);

it’s displaying something anyway.

Ok I was wrong, what I was seeing was imgui replacing the image that it cant find with the text atlas.
SDL_QueryTexture seems to be telling me its an invalid texture.

Edit again, nope it is working.