Note: I have no experience with c# so I might be wrong on some of these things.
You’re probably dealing with jpeg and not the raw pixels that’s required for SDL_UpdateTexture, which is why you use the SDL_image library to deal with the formats.
You’re just trying to display an image which is somewhere in memory that you
can access right?
So just get the buffer containing the raw bytes of the image (in formats
supported by SDL_image), and then create the SDL abstraction for IO which is SDL_RWops which in turn is used by SDL_image through the functions that end in RW (e.g IMG_Load_RW).
Then you can just use the texture or surface however you like.
Note: I’m only not handling errors here to keep it small.
SDL_Renderer *r;
// do things like initializing SDL...
int bufsize;
char *buf = getBuffer(&size);
SDL_Texture *t = IMG_LoadTexture_RW(r, SDL_RWFromConstMem(buf, bufsize), 1);
freeBuffer(buf, bufsize);
SDL_RenderCopy(r, t, NULL, NULL);
SDL_RenderPresent(r);
and if you want the size of the image replace IMG_LoadTexture_RW with:
SDL_Surface *s = IMG_Load_RW(SDL_RWFromConstMem(buf, bufsize), 1);
int width = s->w;
int height = s->h;
SDL_Texture *t = SDL_CreateTextureFromSurface(r, s);
the 1 in IMG_Load*RW is to free the SDL_RWops otherwise you’ll have to
free it yourself with SDL_RWclose