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 17 Dec 2014, 16:07
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 Posts_count_1  
Author Message
MU


Joined: 24 Aug 2005
Posts: 13644
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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0393s ][ Queries: 11 (0.0030s) ][ GZIP on ]