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
= RScaleImage(tmp
, tmp
->width
*atol(argv
[2]),
44 tmp
->height
*atol(argv
[2]));
45 /*img = RSmoothScaleImage(tmp, tmp->width*atol(argv[2]),
46 tmp->height*atol(argv[2]));
54 img
= RScaleImage(img
, img
->width
*atof(argv
[2]),
55 img
->height
*atof(argv
[2]));
59 RImage
*tmp
= RCreateImage(200, 200, True
);
60 RColor col
= {0,0,255,255};
62 if (img
->format
== RRGBAFormat
)
67 RClearImage(tmp
, &col
);
69 RCombineArea(tmp
, img
, 0, 0, 20, 20, 10, 10);
74 if (!RConvertImage(ctx
, img
, &pix
)) {
75 puts(RMessageForError(RErrorCode
));
79 printf("%ix%i\n", img
->width
, img
->height
);
83 win
= XCreateSimpleWindow(dpy
, DefaultRootWindow(dpy
), 10, 10,
84 img
->width
, img
->height
, 0, 0, 0);
85 XSetWindowBackgroundPixmap(dpy
, win
, pix
);
86 XClearWindow(dpy
, win
);