You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
748 B
39 lines
748 B
#include <stdio.h>
|
|
#include "Imlib.h"
|
|
|
|
|
|
int
|
|
main( int ac, char* av[] )
|
|
{
|
|
Display *disp;
|
|
ImlibData *id;
|
|
XSetWindowAttributes attr;
|
|
Window win;
|
|
ImlibImage *img;
|
|
Pixmap p,m;
|
|
int w,h;
|
|
|
|
/* Be nice and tell the user if they don't, to provide a file as an arg */
|
|
if (ac != 2) {
|
|
fprintf( stderr, "usage: %s filename\n", av[0] );
|
|
return 33;
|
|
}
|
|
|
|
/* Connect to the default Xserver */
|
|
disp = XOpenDisplay(NULL);
|
|
|
|
/* Immediately afterwards Intitialise Imlib */
|
|
id = Imlib_init(disp);
|
|
|
|
/* Load the image specified as the first argument */
|
|
img = Imlib_load_image(id,av[1]);
|
|
|
|
|
|
if ( img == NULL ) {
|
|
fprintf( stderr, "failed to load file '%s'.\n", av[1] );
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|