程式語言 - Simple DirectMedia Layer (SDL) - v1.2 - C/C++ - Save BMP



參考資訊:
https://www.libsdl.org/release/SDL-1.2.15/docs/html/index.html

main.c

#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>

int main(int argc, char **argv)
{
    SDL_Surface *bmp = SDL_LoadBMP("main.bmp");
    SDL_SaveBMP(bmp, "saved.bmp");
    SDL_FreeSurface(bmp);
    SDL_Quit();
    return 0;
}

編譯

$ gcc main.c -o main -lSDL -I/usr/include/SDL