libmtpixel is a fork of mtPaint 3.14.42 with all of the GTK+ dependent code removed and a new application program interface (API) added to allow C programs to use mtPaint functions via a C library. This includes file operations, image manipulation, and pixel painting. The sources can be DOWNLOADED HERE.
This package includes several examples such as drawing a graph, creating an animated GIF, a console based image manipulation program, and a CPU load monitor. Here are some images created by these demonstration programs:
Here is what a 'Hello World' program looks like:
#include <libmtpixel.h>
This program is compiled and run by using:
gcc hello.c -lmtpixel -o hello
int main()
{
char *txt = "Hello World", *font_filename = "/usr/X11R6/lib/fonts/truetype/arial.ttf";
}
mtpaint_init();
mtpaint_new_image(320, 240, 256, 0, 3);
mtpaint_col_a(7);
mtpaint_text(txt, strlen(txt), font_filename, "ASCII", 50, 0, 11, MT_TEXT_SHRINK);
mtpaint_paste(0, 0);
mtpaint_file_save("test.png", FT_PNG, 5);
mtpaint_quit();
return 0;
./hello