[SDL] Resize image in SDL_Surface

Glenn Maynard g_sdl at zewt.org
Thu Jan 23 11:27:01 PST 2003

On Thu, Jan 23, 2003 at 01:10:51PM -0600, Corona688 wrote:
> The basic SDL API can't do it;  it just loads, converts, and blits
> surfaces.  There *is* an add-on library for SDL that can, however.  :)
> http://www.ferzkopp.net/Software/SDL_gfx-2.0/  includes image
> stretching, among afew other things.  Just be aware that rotozoom
> doesn't stretch the original image - it produces a new, stretched image
> in memory that'll have to be freed once you're done with it by
> SDL_FreeSurface().

Also be aware that it's very low-quality; unacceptably low for some size
ratios and uses.  (It's written for speed, not quality.)

I've modified the RGBA zoom to do an actual 2:1 sample.  It's slower, but
looks better as long as the size ratio isn't worse than 2:1 or 1:2.


I still need to add options to handle clamp vs. wrap filtering.

I'm still hoping someone's written a triangle filter resize ...

Glenn Maynard

More information about the SDL mailing list