Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changing SVGNode Content (Read 1325 times)
FrankR
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 7th, 2010
Changing SVGNode Content
Jul 28th, 2010 at 12:44pm
Print Post  
I'm using Diagramming ver 5.3 with VB.Net in Visual Studio 2008, and want to change the content of some existing SVGNodes when the user makes a change to the application. Here is how I am changing the content to the desired node:

svgNode.Content.Parse(sFileName)
'force node to refresh
svgNode.Shape = svgNode.Shape

The SVG images are similar except for 1 is more opaque than the other - its alpha value is higher. When an SVGNode is first drawn it uses the more transparent image and is very discernible from the more opaque version. But if I change the content SVG image from the more opaque to the more transparent there is no noticable difference, as though the more transparent version is painted over the top of the existing more opaque image which "shines through."

I've tried refreshing the Diagram and DiagramView using the following calls:

mfMainDiagram.Invalidate(svgNode.GetRepaintRect(False))

mfMainDiagramView.Refresh()

Any suggestions?

Thanks,

Frank R
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Changing SVGNode Content
Reply #1 - Jul 28th, 2010 at 1:09pm
Print Post  
Hi,

SvgContent.Parse adds to the current SVG elements instead of replacing them. You could create a new SvgContent instance, load the new file into it and assign to SvgNode.Content.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
FrankR
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 7th, 2010
Re: Changing SVGNode Content
Reply #2 - Jul 28th, 2010 at 1:30pm
Print Post  
That works great, thanks.

I went back and looked at the developer's guide and couldn't find a reference to Content.Parse adding rather than replacing SVG content. It might be good to add this information to the guide in a future version.

Thanks again for the prompt response.

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