OS4 DepotLogo by Browallia 
(anonymous IP:,2193) 

   Bug tracker
   Locale browser


   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (596)
   o Document (22)
   o Driver (97)
   o Emulation (147)
   o Game (1005)
   o Graphics (497)
   o Library (115)
   o Network (232)
   o Office (66)
   o Utility (923)
   o Video (69)

Total files: 4366

Full index file
Recent index file



Support the site

 Readme for:  Development » Example » sdlpngsavesurf.lha


Description: An example on how to save a SDL surface as PNG
Download: sdlpngsavesurf.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 343kb
Date: 13 Nov 2006
Author: Angelo "Encelo" Theodorou, AmigaOS 4.0 compile by Spot / Up Rough
Submitter: Spot / Up Rough
Email: spot/triad se
Category: development/example
License: Other
Distribute: yes
Min OS Version: 4.0
FileID: 2307
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 1200  (Current version)
1200  (Accumulated)
Votes: 1 (0/0)  (30 days/7 days)

Show comments Show snapshots Show videos Show content Show crashlogs Replace file 
SaveSurf: an example on how to save a SDL surface in PNG
Copyright (C) 2006 Angelo "Encelo" Theodorou

A quick and dirty example on how to save a SDL surface (loaded with SDL_image)
in a PNG image using libpng.
It is *heavy* inspired by this post:
http://www.libsdl.org/pipermail/sdl/2001-May/036068.html, written by Darren
Grant in 2001 and meant to be a SDL_image patch.

- libSDL
- SDL_image
- libpng

$gcc savesurf.c -o savesurf -lSDL -lSDL_image -lpng

This program is part of "Mars, Land of No Mercy" SDL examples, you can find
other examples on http://marsnomercy.org/sdl_ex.php.
The savescreen version shows how to make a screenshot of the screen blitting it
first on an output surface, then saving it.

Copyright © 2004-2024 by Björn Hagström All Rights Reserved