PDA

View Full Version : Drawing API in Laszlo


dkim
10-06-2004, 07:32 AM
Hi,

I'm trying to implement a simple graph class.
Is there a simple way to directly draw a line on a view like a Drawing API?

If not, I think what I might be able to do is create a gigantic swf file where I pass in all the lineTo cordinates... but that seems like a big messey ball of tar.

Daniel

TomChiverton
10-07-2004, 12:55 AM
> Is there a simple way to directly draw a line on a
> view like a Drawing API?

I'd be intrested in such a best too - I've just posted a question about creating components at run time that should provide the answer to if it is possible or not.

d~l
10-07-2004, 06:49 AM
I'm experimenting with a combination of PHP and Laszlo .. PHP5.0.2 generating LZX scripts "on the fly" ..

one thread here ..

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&postid=3983#post3983

It would be nice if PHP was co-located on Tomcat server .. instead of separate Apache+PHP server ..

I'm exploring that option (it has been done see here .. http://wiki.apache.org/jakarta-tomcat/UsingPhp .. ) .. but I have not yet got PHP5 to work on Tomcat.

..

if PHP is used for dynamic lzx script generation then of course PHP Ming extension could draw lines "on the fly".

Possibly better for a drawing API, SVG embedded in LZX could be used. But note that SVG requires an Adobe SVG plug-in in each client browser (other than Mozilla which has native SVG viewer).

And here is the SVG API .. draw paths .. http://www.w3.org/TR/SVG/paths.html

As a relative newcomer to Laszlo I'm not sure, yet, what of the above "on the fly" stuff can be done in "native Laszlo" scripting. But PHP+LZX+SVG looks interesting.

dteare
10-10-2004, 11:19 AM
I would like similar functionality. Ideally I would be able to "paint" the user's screen, without contacting the server to render new content.

Is there any such API that would allow me to programmatically draw Lines, color fill regions, etc. all within Flash on the clients machine?

Thanks!
--Dave.

UV2003
02-06-2005, 01:47 PM
I found this pacakge this afternoon. It is under the Mozilla Public License and looks very cool so far:

http://www.alex-uhlmann.de/flash/animationpackage/

Some samples:
http://www.alex-uhlmann.de/flash/animationpackage/de/alex_uhlmann/animationpackage/drawing/Spiral_03.html

http://www.alex-uhlmann.de/flash/animationpackage/de/alex_uhlmann/animationpackage/drawing/Gear_04.html
Code:
var myGear:Gear = new Gear(275,200,30,100,10);
myGear.lineStyle(2,0xff0000,100);
myGear.fillStyle(0xff0000,100);
myGear.draw();

For Lines:

http://www.alex-uhlmann.de/flash/animationpackage/de/alex_uhlmann/animationpackage/drawing/Line_doc.html

This is a very very cool package and will let me do some things in some of my own animations independent of Laszlo that I didn't know how to do and didn't have the experience to learn quickly.

I hope this is helpful,
Josh


Originally posted by dteare
I would like similar functionality. Ideally I would be able to "paint" the user's screen, without contacting the server to render new content.

Is there any such API that would allow me to programmatically draw Lines, color fill regions, etc. all within Flash on the clients machine?

Thanks!
--Dave.

UV2003
02-06-2005, 01:48 PM
WOW:

http://www.alex-uhlmann.de/flash/animationpackage/de/alex_uhlmann/animationpackage/drawing/SuperShape_doc.html

AWESOME!

d~l
02-07-2005, 01:03 AM
If you have PHP then add these to the list ..

PHP + Freemovie (http://freemovie.sourceforge.net/#fm-php)

PHP SWF Charts (http://www.maani.us/charts/index.php)

both discussed here .. (http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=758&perpage=15&highlight=charts&pagenumber=2)

jbarciela
02-10-2005, 11:17 AM
Originally posted by UV2003
I found this pacakge this afternoon. It is under the Mozilla Public License and looks very cool so far:

http://www.alex-uhlmann.de/flash/animationpackage/

...

var myGear:Gear = new Gear(275,200,30,100,10);
myGear.lineStyle(2,0xff0000,100);
myGear.fillStyle(0xff0000,100);
myGear.draw();

...



Thanks for the link UV2003,

This package is really cool, I have been looking for something like this for a while. But I understand that in a lzx you can only put xml + javascript; how can you combine this with laszlo? To draw a line that joins to views, for example?

Sorry if the question sounds stupid, I'm a java developer that knows nothing about flash

My goal is to create things like this http://www.jgraph.com/showcase.html

Thanks
Jaime