Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Apr 2014, 21:29
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
ImlibBasic-2.5-pre-alpha
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 19 Mar 2007, 20:26    Post subject:  ImlibBasic-2.5-pre-alpha  

http://noforum.de/files/wxbasic/ImlibBasic/

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:
#!./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


If you have some knowledge in C, and want to add own functions:

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/doxy/imlib2/index.html
mirror:
http://olympus.het.brown.edu/cgi-bin/dwww?type=html&location=/usr/share/doc/libimlib2-dev/html/index.html

Mark
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0358s ][ Queries: 12 (0.0044s) ][ GZIP on ]