Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) SVG Node (Read 3766 times)
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
SVG Node
Oct 5th, 2009 at 8:58am
Print Post  
Hi,

i need some SVGNodes in my little application, like the mindfusion iconnode sample. Is there anywhere a code-snippet how i could realize this task? That meens i have to write a new "SVG_Node" class with a custom svg-image and custom properties for each SVGNode.

I have tried the following code:



'
' Copyright (c) 2003-2009, MindFusion LLC - Bulgaria.
'
Imports System.Drawing.Imaging
' ...
Imports MindFusion.Diagramming
Imports MindFusion.Drawing
Imports MindFusion.Svg


Public Class IconNode_Node
Inherits SvgNode

Shared Sub New()

End Sub

Public Sub New(ByVal diagram As Diagram)
' ...
MyBase.New(diagram)
' ...
Dim newContent As New SvgContent()
newContent.Parse(Application.StartupPath & "\images\Node.svg")
' ...
Content = newContent
Transparent = True
HandlesStyle = MindFusion.Diagramming.HandlesStyle.EasyMove
' ...
End Sub

End Class


This code works, but if i select a svgnode in my diagram, a white rectangle appears over the selected svgnode, but why...???

greeze Marco
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Node
Reply #1 - Oct 5th, 2009 at 10:23am
Print Post  
Does it appear if you set HandlesStyle to a different value?
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: SVG Node
Reply #2 - Oct 5th, 2009 at 10:33am
Print Post  
Hi Stoyo,

i have found my mistake, i also attach a IconNode to the SVGNode which lies over the SVGNode.

What do you think about the above posted code?Im not shure, but should i add the draw and drawshadow Sub to the class?
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: SVG Node
Reply #3 - Oct 5th, 2009 at 11:02am
Print Post  
Hi Stoyo,

another question, is there any problem when i use svg's which i created with inkscape? Because if i use inkscape svg's i get realy bad image-quality...

greeze marco
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Node
Reply #4 - Oct 5th, 2009 at 12:14pm
Print Post  
1. It depends on whether you need to draw anything else apart from the SVG?

2. We have recently found there's some kind of "pattern" objects in SVG, which we haven't implemented in our rendering library. Are you using this feature in your SVG file? Could you email it to support@mindfusion.eu in any case?

Stoyan
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: SVG Node
Reply #5 - Oct 6th, 2009 at 10:31am
Print Post  
Hi Stoyan,

i have send you the svg to the support email.

Now i have created some svg with the new Adobe illustrator CS4. Now if i try to parse the content / add the svgNode, it takes about 5 seconds until the Node appears in my diagram!?

Im not realy shure about the save-settings...
The SVG-Profile is set to SVG1.0, is this right?

Greeze Marco
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Node
Reply #6 - Oct 6th, 2009 at 10:53am
Print Post  
What version of the control are you using? The parsing speed was improved a lot in version 5.3.1. We'll check what's wrong with the curve elements now.
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: SVG Node
Reply #7 - Oct 6th, 2009 at 10:55am
Print Post  
Im using version 5.3.2.23158 ...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Node
Reply #8 - Oct 6th, 2009 at 10:57am
Print Post  
Is the file you sent us the one created with Adobe CS? It gets loaded instantly in my test project. If not, could you send us the Adobe file too?
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: SVG Node
Reply #9 - Oct 6th, 2009 at 11:03am
Print Post  
it is the on which i have created with inkscape, i will send you now the svg from ia cs4...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Node
Reply #10 - Oct 6th, 2009 at 11:19am
Print Post  
It took less than a second to load on my system, You might try removing the following line form the svg:

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

Otherwise the MSXML parser downloads the dtd file to validate the xml schema, so it might take more time depending on the Internet connection speed.
  
Back to top
 
IP Logged
 
mberger
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 44
Joined: Jan 6th, 2009
Re: SVG Node
Reply #11 - Oct 6th, 2009 at 11:27am
Print Post  
... thanks alot Stoyo after i remove Doctype Tag it works fine!!!

greeze Marco
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: SVG Node
Reply #12 - Oct 6th, 2009 at 12:59pm
Print Post  
We've fixed the problem with the curves too. We are making some other changes right now, but will try to upload a stable build with the fix in a few days.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint