Skip to content

@sidorares /gist:2583233
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
PutImage + 32 bit pixmap example
var x11 = require('../../lib/x11');
x11.createClient(function(display) {
X = display.client;
var w = 100;
var h = 200;
var root = display.screen[0].root;
var pix = X.AllocID();
X.CreatePixmap(pix, root, 32, w, h);
var gc = X.AllocID();
X.CreateGC(gc, root);
X.require('render', function(Render) {
var pic = X.AllocID();
Render.CreatePicture(pic, pix, Render.rgba32);
// (format, drawable, gc, width, height, dstX, dstY, leftPad, depth, data)
data = new Buffer(h*w*32);
X.PutImage(2, pix, gc, w, h, 0, 0, 0, 32, data);
});
X.on('error', function(err) { console.log(err); });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.