15 main(int argc
, char **argv
)
17 RContextAttributes attr
;
19 dpy
= XOpenDisplay("");
21 puts("cant open display");
25 attr
.flags
= RC_RenderMode
| RC_ColorsPerChannel
;
26 attr
.render_mode
= RDitheredRendering
;
27 attr
.colors_per_channel
= 4;
28 ctx
= RCreateContext(dpy
, DefaultScreen(dpy
), &attr
);
31 img
= RGetImageFromXPMData(ctx
, image_name
);
33 img
= RLoadImage(ctx
, argv
[1], 0);
36 puts(RMessageForError(RErrorCode
));
43 img = RSmoothScaleImage(tmp, tmp->width*atol(argv[2]),
44 tmp->height*atol(argv[2]));
50 img
= RScaleImage(img
, img
->width
*atof(argv
[2]),
51 img
->height
*atof(argv
[2]));
55 RImage
*tmp
= RCreateImage(200, 200, True
);
56 RColor col
= {0,0,255,255};
58 if (img
->format
== RRGBAFormat
)
63 RClearImage(tmp
, &col
);
65 RCombineArea(tmp
, img
, 0, 0, 20, 20, 10, 10);
70 if (!RConvertImage(ctx
, img
, &pix
)) {
71 puts(RMessageForError(RErrorCode
));
75 printf("%ix%i\n", img
->width
, img
->height
);
79 win
= XCreateSimpleWindow(dpy
, DefaultRootWindow(dpy
), 10, 10,
80 img
->width
, img
->height
, 0, 0, 0);
81 XSetWindowBackgroundPixmap(dpy
, win
, pix
);
82 XClearWindow(dpy
, win
);