You can also do it by hand copying pixel per pixel …
But you need to know a little bit of direct access to pixels,
algorithmic, and antialiasing for zoom in.
To give an idea, if you divide an image size by two, you
simply copy pixels with an even x and y coordinate.
This is a very simply example, it is not so straightforward
when the destination size is not an exact divisor of the original size …
(or only the width, not the height and vice versa).
When you make an image bigger, aliasing appear and you need
to apply an antialiasing filter to it (neighbours, gauss, etc.).
If you want to play and learn new things, try doing it by hand, else,
as Andre suggested, use a library having this feature implemented for you,
like SDL_gfx.
Regards
----- Message d’origine ----De : Leo Cabrera
? : A list for developers using the SDL library. (includes SDL-announce)
Envoy? le : Vendredi, 25 Juillet 2008, 15h56mn 58s
Objet : Re: [SDL] Image resize
Use the rotozoom feature of SDL_gfx.
Andre Botelho wrote:
is there a fast way to resize images on SDL?
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr