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
);
30 img
= RGetImageFromXPMData(ctx
, image_name
);
32 img
= RLoadImage(ctx
, argv
[1], 0);
35 puts(RMessageForError(RErrorCode
));
42 img = RSmoothScaleImage(tmp, tmp->width*atol(argv[2]),
43 tmp->height*atol(argv[2]));
49 img
= RScaleImage(img
, img
->width
*atof(argv
[2]),
50 img
->height
*atof(argv
[2]));
52 if (!RConvertImage(ctx
, img
, &pix
)) {
53 puts(RMessageForError(RErrorCode
));
57 win
= XCreateSimpleWindow(dpy
, DefaultRootWindow(dpy
), 10, 10,
59 img
->height
, 0, 0, 0);
61 XSetWindowBackgroundPixmap(dpy
, win
, pix
);
62 XClearWindow(dpy
, win
);