Extract somewhere, then cd there and run:
./imlib.pb
It is a Puppybasic with a few additional functions using the graficslibrary "imlib2".
You can load, save, scale pictures.
I started also on creating windows, but this is far from usable yet.
Here is an example-program:
Code: Select all
#!./imlibbasic
//-- there are 2 image-buffers, 1 and 2
//-- every imlib_command must have a buffer as first argument
//-- load
imlib_loadpic(1,"gaim.png")
//--scale
imlib_resamplepic(1,100 , 50)
//-- save
imlib_savepic(1,"gaim.jpg")
//-- create a window
l = xwin_createsimplewindow()
winid = "0x" & l[0]
l={}// free memory
print winid
xwin_activate(winid)
xwin_resize(winid , 200 , 200)
xwin_move(winid , 200 , 200)
shell("sleep 2")
xwin_move(winid , 400 , 400)
imlib_drawpictowindow(1, winid)
//-- create a second window
l = xwin_createsimplewindow()
winid2 = "0x" & l[0]
l={}// free memory
print winid2
xwin_activate(winid2)
xwin_resize(winid2 , 100 , 100)
xwin_move(winid2 , 30 , 30)
shell("sleep 2")
xwin_move(winid2 , 100 , 100)
imlib_loadpic(1,"gaim.png")
imlib_drawpictowindow(1, winid2)
//-- Main-loop, must be replaced with an eventloop in C that updates the windows
while 1
xwin_usleep(100000)
wend
add new declarations to builtin.h (2 lines for every function).
Then add the function to imlib.c.
Another function-lib by me is xwin.c, it has more low-level struff like moving windows.
Then compile with:
./_compileimlibbasic.sh
imlib2-docs:
http://www.enlightenment.org/Libraries/Imlib2/
currently down:
http://enlightenment.sourceforge.net/do ... index.html
mirror:
http://olympus.het.brown.edu/cgi-bin/dw ... index.html
Mark