Hi,
Am 22.09.2014 um 13:06 schrieb Joren Heit:
> The client-table contains a field called 'content', which is an image
> representing the client window. Does anyone know how I can draw this onto a
> Cairo context?
$ echo 'local cairo = require("lgi").cairo local surface =
cairo.ImageSurface(cairo.Format.RGB24, 20, 20) local cr = cairo.Context(surface)
cr:set_source_surface(require("gears.surface")(client.focus.content), 0, 0)
cr:paint() surface:write_to_png("/tmp/foo.png")' | awesome-client
$ ls -l /tmp/foo.png
-rw-r--r-- 1 psychon psychon 358 Sep 23 09:47 /tmp/foo.png
$ feh /tmp/foo.png
[Displays some random character from my terminal]
Same code with some more line breaks:
local cairo = require("lgi").cairo
local surface = cairo.ImageSurface(cairo.Format.RGB24, 20, 20)
local cr = cairo.Context(surface)
cr:set_source_surface(require("gears.surface")(client.focus.content), 0, 0)
cr:paint()
surface:write_to_png("/tmp/foo.png")'
Cheers,
Uli
--
Happiness can't be found -- it finds you.
- Majic
--
To unsubscribe, send mail to [email protected].