javascript and pixbuf color



Hi,

how can I get color of one pixel (rgba)?

I have tried this, but it does not work, coz it returns number, and in JS pointers not work

const GdkPixbuf = imports.gi.GdkPixbuf

let pixbuf = GdkPixbuf.Pixbuf.new_from_file('zive.ico')
let nChannels = pixbuf.get_n_channels()

let pixels = pixbuf.get_pixels()
let rowstride = pixbuf.get_rowstride()
x = 0
y = 0
p = pixels + y * rowstride + x * nChannels


Thanks



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]