Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Visio Shape Line Color (Read 218 times)
G_G
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 8th, 2021
Visio Shape Line Color
May 17th, 2024 at 6:03am
Print Post  
When using VisioShapes, is there any way to change the Line or Fill Color of the VisioShapes loaded from our stencil?
Brush and Pen Properties are there but dont seem to alter the VisioShape Color.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3207
Joined: Oct 19th, 2005
Re: Visio Shape Line Color
Reply #1 - May 20th, 2024 at 7:41am
Print Post  
Vsx.Shape has BackgroundColor and ForegroundColor properties. This build also adds LineColor:

https://mindfusion.eu/_beta/fcnet703.zip

A stencil master can contain multiple nested shapes, e.g. the ones from the stencil you attached to another thread go three levels deep:

Code
Select All
foreach (var shape in visioNode.Content.Master.Shapes)
{
	shape.LineColor = Color.Red;

	foreach (var level2 in shape.Shapes)
	{
		level2.LineColor = Color.Blue;

		foreach (var level3 in level2.Shapes)
			level3.LineColor = Color.Green;
	}
} 



I guess you could set it recursively if you want a uniform color applied.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
G_G
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 8th, 2021
Re: Visio Shape Line Color
Reply #2 - May 21st, 2024 at 8:00am
Print Post  
The LineColor works with the updated Library (ForegroundColor and BackgroundColor didn't but this might be related to the visio shape data i guess).

Since this requires the newer Library version to be used, we are back to having to resolve the drag and drop issue, i will add to this topic accordingly.
  
Back to top
 
IP Logged
 
G_G
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 8th, 2021
Re: Visio Shape Line Color
Reply #3 - May 22nd, 2024 at 9:27am
Print Post  
We use this sub to color the visioshapes, linecolor works fine now, is the background and foreground property not working related to the visio data or are we missing some setting?

    Private Sub ColorAllIncludedShapes(v As VisioNode, c As System.Drawing.Color)
        For Each s As MindFusion.Vsx.Shape(Of color, Drawing.Image) In v.Content.Master.Shapes
            For Each si As MindFusion.Vsx.Shape(Of color, Drawing.Image) In s.Shapes
                si.ForegroundColor = c
                si.BackgroundColor = c
                si.LineColor = c
            Next
            s.ForegroundColor = c
            s.BackgroundColor = c
            s.LineColor = c
        Next
    End Sub
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3207
Joined: Oct 19th, 2005
Re: Visio Shape Line Color
Reply #4 - May 22nd, 2024 at 11:10am
Print Post  
Check the vsx file's XML code for the stencil master you are interested in. Most of the shapes in what you attached earlier seem to define single-line geometries and apply NoFill property:

Code
Select All
<Geom IX="0">
  <NoFill>1</NoFill>
  <NoLine>0</NoLine>
  <NoShow>0</NoShow>
  <NoSnap F="No Formula">0</NoSnap>
  <MoveTo IX="1">
    <X F="Width*0">0</X>
    <Y F="Height*1">0.1023622047244094</Y>
  </MoveTo>
  <LineTo IX="2">
    <X F="Width*0">0</X>
    <Y F="Height*0">0</Y>
  </LineTo>
</Geom> 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint