How to create a compatible surface?

Hello,

I have a small (probably quite stupid) question.

When I have an arbitrary surface (possibly indexed, or truecolor,
alpha, or not alpha, whatever), is there any simple way to create
a new surface with different size but otherwise with same properties?
(e.g. the same bit depth, same color palette, same color key,
same alpha, etc.)?

Have a nice day,

Jiri “BlueBear” Dluhos–

It is really quite easy to imagine a square yard of multidimensional
space, provided that you have seven brains.

                                      Prof. Abdullah Nightingale
                (Walter Moers: 13 1/2 lives of Captain Bluebear)

Jiri “BlueBear” Dluhos
Software Developer, HUMUSOFT s.r.o. (http://www.humusoft.com)
dluhos at humusoft dot com (office)
dluhosj at centrum dot cz (home)

When I have an arbitrary surface (possibly indexed, or truecolor,
alpha, or not alpha, whatever), is there any simple way to create
a new surface with different size but otherwise with same properties?
(e.g. the same bit depth, same color palette, same color key,
same alpha, etc.)?

SDL_CreateRGBSurface() with the same depth and RGBAmasks as the original,
then SDL_SetAlpha() and SDL_SetColorKey() as needed