Page 4 of 5

Re: PureSVG - now with LoadSVG() !

Posted: Fri Jul 22, 2011 3:50 am
by electrochrisso
I have been thinking that it might be better off waiting for a while so you can concentrate on implementing the filters and canvas and perhaps animation into the code, as this would be a great addition. I still have to spend a bit of time learning about svg anyway, and have a heap of other coding to catch up on, and I do have your existing code to trawl and learn from for the time being.

Re: PureSVG - now with LoadSVG() !

Posted: Fri Jul 22, 2011 1:52 pm
by Seymour Clufley
Animation will not be in the next version, because I haven't decided how to implement it. SVG elements can be animated in different ways - JavaScript, SMIL and CSS among them. I don't know enough to make the right choice!

However, canvas and filters are do-able. :)

Re: PureSVG - now with LoadSVG() !

Posted: Tue Aug 02, 2011 7:29 pm
by Seymour Clufley
Electrochrisso, I am currently working on PureSVG, implementing canvas drawing. (I should be specific: this will be for converting an SVG into JavaScript code for drawing on an HTML5 canvas, not PB's canvas.)

I also checked Wikipedia again and it seems SMIL is now the recommended way to animate SVG. It's good that a consensus has emerged. SMIL+SVG is supported by all the browsers except IE (of course) though IE10 may fix this. Therefore I will implement SMIL in PureSVG, so that people can make animations with PureBasic!

This won't be in the upcoming version, though. I want that to be focused on filters, canvas, and using less memory. Animation will be in the next version.

Re: PureSVG - now with LoadSVG() !

Posted: Wed Aug 03, 2011 3:31 pm
by Seymour Clufley
I tell a lie.

Last night I took the plunge and implemented two of SVG's three animation functions:
  • Animate
  • AnimateMotion
So those will certainly be in the next version. I still need to do AnimateTransform. Some "helper" functions for animators were also written - copy, paste, clear all, etc.

I also started writing the canvas code. Once that is done, the only thing left is filters. These are more complicated! I may leave some filters for a future version.

Re: PureSVG - now with LoadSVG() !

Posted: Wed Aug 03, 2011 7:48 pm
by c4s
This whole SVG support looks good. I'm pretty excited ybout your new update as well!

Re: PureSVG - now with LoadSVG() !

Posted: Thu Aug 04, 2011 12:58 am
by Seymour Clufley
Thanks, c4s! Encouragement is always appreciated!

Re: PureSVG - now with LoadSVG() !

Posted: Thu Aug 04, 2011 3:49 am
by electrochrisso
Hi Semour, sorry I could not reply sooner, I was up the Murray River in my paddle boat and offline for a few days and have just caught back up with the forum.
Your next version sounds great with a lot of new features. 8)
I am new to SVG and will now need to go and check out info on HTML5 and SMIL. :idea:
Keep up the good work. :)

Re: PureSVG - now with LoadSVG() !

Posted: Thu Aug 04, 2011 5:32 am
by Seymour Clufley
electrochrisso wrote:Your next version sounds great with a lot of new features. 8)
Well, I hope it doesn't disappoint! To be honest, I think the best thing about it is that it uses about 5% of the memory that the last version used. Real improvements have been made there.

But of course it's more exciting for a new version to have new features! There are quite a few of them already. Animation and canvas will be in it. Filters, not so sure.
I am new to SVG and will now need to go and check out info on HTML5 and SMIL. :idea:
Ideally, PureSVG should take care of SMIL for you. However, it may be useful for you to know about this stuff so that you can suggest improvements to PureSVG (apart from anything else). I'm trying to support as much of the spec as possible, but I may have overlooked some stuff because I'm no expert myself!

The SVG spec is much more extensive than it looks. The best thing is to imagine what you'd like to be able to do in PB code, then build a bridge to it.

On that note, is there anything you'd like to be able to do, in terms of animation? Any way you'd like it to work?

Re: PureSVG - now with LoadSVG() !

Posted: Fri Aug 05, 2011 7:35 am
by electrochrisso
On that note, is there anything you'd like to be able to do, in terms of animation? Any way you'd like it to work?
I will check out a bit of info and get back to you soon. :)

Re: PureSVG - now with LoadSVG() !

Posted: Mon Aug 08, 2011 4:24 am
by electrochrisso
I think that I will leave for you to work out the best way to implement the animation, as I am still wading through hundreds of pages of docs on SVG and SMIL. The more I look into this language the more seems to appear and is way more than just a simple graphics engine. I have so far only read a basic tutorial on rotating, moving and scaling an element, so these would be a useful addition.
Here is a link to an advanced animation. http://apike.ca/prog_svg_animaze.html, would this be possible?.
Because there are so many commands to this language and it codes like html and xml it might be easier to somehow implement a way to use PB as the front end for the coding and testing using the w3c syntax (like the simple example SVG code below), then output the code to a viewer, or event better if the web gadget is now able to read the code, since ie9+ is supposed to be able to do now. I am still checking out what is possible myself to see what ie or Firefox are currently capable of in this arena, I will keep you posted on my progress.

Code: Select all

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="rotateSquare">
<rect fill="#AFBCC7" stroke="#646464" stroke-width="5px" x="100px" y="100px" width="100px" height="100px">
<animateTransform
attributeType="XML"
attributeName="transform"
type="rotate"
from="0,150,150" to="360,150,150"
begin="0s" dur="5s"
repeatCount="indefinite"/>
</rect>
</g>
</svg>

Re: PureSVG - now with LoadSVG() !

Posted: Thu Mar 29, 2012 3:27 pm
by Seymour Clufley
Someone else can worry about that. I have little interest in making apps with PB. The web is the platform now.

Re: PureSVG - now with LoadSVG() !

Posted: Thu Mar 29, 2012 3:38 pm
by Didelphodon
The chm-file included in the download archive seems to be broken. At least I don't get any information in the pane on the right side besides some "cant-connect-error".

Re: PureSVG - now with LoadSVG() !

Posted: Fri Mar 30, 2012 12:16 am
by Seymour Clufley
I'll be uploading a new version soon. In the meantime I'll PM you a help file.

Re: PureSVG - now with LoadSVG() !

Posted: Sat Apr 21, 2012 2:42 am
by Seymour Clufley
Mevedia, I'm afraid I am extremely busy just now. The functionality you want would not be of any use to my own projects, so I can't justify abandoning my current work to do this. If someone else wants to do it, that's great, but I can't.

Re: PureSVG - now with LoadSVG() !

Posted: Sat Apr 21, 2012 10:21 am
by Danilo
@mevedia.de:
If EMF (Windows Enhanced Metafile) is OK instead SVG, you can try gDrawing_v0.85b.zip.
This experimental version of gDrawing has gLoadMetafile() for loading EMF and WMF
and gMetafileOutput() for writing EMF.