14 int main(int argc
, char **argv
)
16 RContextAttributes attr
;
18 dpy
= XOpenDisplay("");
20 puts("cant open display");
23 attr
.flags
= RC_RenderMode
| RC_ColorsPerChannel
;
24 attr
.render_mode
= RDitheredRendering
;
25 attr
.colors_per_channel
= 4;
26 ctx
= RCreateContext(dpy
, DefaultScreen(dpy
), &attr
);
28 img
= RGetImageFromXPMData(ctx
, image_name
);
30 img
= RLoadImage(ctx
, argv
[1], 0);
33 puts(RMessageForError(RErrorCode
));
40 img = RSmoothScaleImage(tmp, tmp->width*atol(argv[2]),
41 tmp->height*atol(argv[2]));
47 img
= RScaleImage(img
, img
->width
*atof(argv
[2]),
48 img
->height
*atof(argv
[2]));
50 if (!RConvertImage(ctx
, img
, &pix
)) {
51 puts(RMessageForError(RErrorCode
));
55 win
= XCreateSimpleWindow(dpy
, DefaultRootWindow(dpy
), 10, 10,
57 img
->height
, 0, 0, 0);
59 XSetWindowBackgroundPixmap(dpy
, win
, pix
);
60 XClearWindow(dpy
, win
);