blob: c866947656e73a1719461b292ffb21ff3ea4c23a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#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;
}
|