File: 036-image.lua

package info (click to toggle)
lua-gtk 0.9%2B20100528-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,176 kB
  • ctags: 1,934
  • sloc: ansic: 9,571; sh: 373; makefile: 241
file content (14 lines) | stat: -rwxr-xr-x 343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /usr/bin/env lua
-- vim=sw:4:sts=4

require "gtk"

local png = gdk.pixbuf_new_from_file("036.png", nil)
assert(png, "Can't load file 036.png")

local pixmap, bitmap = png:render_pixmap_and_mask(gnome.NIL, gnome.NIL, 128)
assert(pixmap)
assert(pixmap:lg_get_type() == "GdkPixmap")
assert(bitmap)
assert(bitmap:lg_get_type() == "GdkBitmap")