14 int main(int argc
, char **argv
)
16 RContextAttributes attr
;
18 dpy
= XOpenDisplay("");
20 puts("cant open display");
24 attr
.flags
= RC_RenderMode
| RC_ColorsPerChannel
;
25 attr
.render_mode
= RDitheredRendering
;
26 attr
.colors_per_channel
= 4;
27 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 printf("%ix%i\n", img
->width
, img
->height
);
61 win
= XCreateSimpleWindow(dpy
, DefaultRootWindow(dpy
), 10, 10,
63 img
->height
, 0, 0, 0);
64 XSetWindowBackgroundPixmap(dpy
, win
, pix
);
65 XClearWindow(dpy
, win
);