We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Please provide Shape.CellsSRC and related API- to improve Aspose Diagram API's compatibility with Visio Object model

https://msdn.microsoft.com/en-us/library/office/aa221218(v=office.11).aspx
Welcome to the Microsoft Office Visio 2003 SDK [Visio 2003 SDK Documentation]
https://msdn.microsoft.com/en-us/library/office/aa175615(v=office.11).aspx
Visio Object Model [Visio 2003 SDK Documentation]
https://msdn.microsoft.com/en-us/library/office/aa215160(v=office.11).aspx
CellsSRC Property [Visio 2003 SDK Documentation]
https://msdn.microsoft.com/en-us/library/office/aa175539(v=office.11).aspx
Cell Object [Visio 2003 SDK Documentation]

https://msdn.microsoft.com/EN-US/library/office/ff767394.aspx
Shape.CellsSRC Property (Visio 2013)
https://msdn.microsoft.com/EN-US/library/office/ff765137.aspx
Cell Object (Visio 2013)

As shown in the links above, at least since Visio 2003, one can already use Shape.CellsSRC property to access any shape formula by its section, row, and column indices. Shape.CellsSRC is very important to manipulate Visio Diagram.

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ea8b6386-7bc6-4566-bb75-afed34f0f1b2/edit-fill-gradient-stops-values-vba?forum=officegeneral
Edit Fill Gradient Stops Values

For example, as shown in the link above, one can use Shape.CellsSRC to edit fill gradient stop values.

I mean, it seems to me that Visio 2013 introduces multi-stop gradient fills, and because currently Aspose Diagram only supports modifying "shape.Fill.FillBkgnd and shape.Fill.FillForegnd", it does not provide any way to modify individual gradient stop if there are more than two of them.




Hi Jiaguo,


Thank you for contacting support. We’re working over your query and will get back to you soon.

Hi Jiaguo,


Thank you for being patient. We have logged a feature request under ticket ID DIAGRAMNET-51081 to modify the individual gradient stops. Your post has also been linked to this ticket. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

Hi Jiaguo,


Thank you for being patient. We have a good news for you that the ticket ID DIAGRAMNET-51081 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version 16.12.0 of Aspose.Diagram for .NET API. We’ll inform you via this forum thread as soon as the new release is published.

Hi Jiaguo,


Thank you for being patient. In reference to the ticket ID DIAGRAMNET-51081, please download and use the latest Hotfix version: Aspose.Diagram for .NET 16.11.2.0. Please also let us know how that goes on your side.

Sample code to modify an individual gradientstop
[.NET, C#]
<span style=“color: rgb(0, 128, 0); background-color: rgb(255, 255, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// load a diagram
Diagram diagram = new Diagram(@“c:\temp\Drawing1.vsdx”);
// get collection of the gradientstops
GradientStopCollection stops = diagram.Pages[0].Shapes[0].Fill.GradientFill.GradientStops;
// get gradientstop by index
GradientStop stop = stops[0];
// set position value
stop.Position.Value = 0.5;
// save diagram
diagram.Save(@“c:\temp\Output.vsdx”, SaveFileFormat.VSDX);

Could you help to provide a complete working sample of changing the shape’s fill to gradientfill and setup its gradient stops ?

Your sample code does not help me with the “// How to enable gradient fill here ?” part of the code below. Many thanks for your efforts !

// https://github.com/aspose-diagram/Aspose.Diagram-for-.NET/tree/master/Examples/Data/Knowledge-Base
public static void Test1_TryAsposeStencil()
{
// Create a new diagram
Diagram diagram = new Diagram(“Basic Shapes.vss”, LoadFileFormat.VSS); // https://github.com/aspose-diagram/Aspose.Diagram-for-.NET/tree/master/Examples/Data/Knowledge-Base

// Add a new circle shape
shapeId = diagram.AddShape(2.0, 2.5, 2, 2, @“Circle”, 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Fill.FillBkgnd.Value = “#ff0000”;
shape.Text.Value.Add(new Txt(@“Circle 1.”));
// Necessary for setting text position
shape.TextXForm.TxtPinX.Ufe.F = “Width<em>0.5";
shape.TextXForm.TxtPinY.Ufe.F = "Height</em> 0.5”;

// How to enable gradient fill here ?
shape.FillStyle??? = GradientFillType.Radial;
shape.FillStyle??? = GradientStyleType.FromCenter;
stops.Add(new DoubleValue(0.0, MeasureConst.Undefined), new ColorValue("#FFFFFF", MeasureConst.Undefined));
stops.Add(new DoubleValue(0.5, MeasureConst.Undefined), new ColorValue("#FF0000", MeasureConst.Undefined));

// Save the new diagram
string outputDiagramPath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType + “.” + System.Reflection.MethodBase.GetCurrentMethod().Name;
diagram.Save(outputDiagramPath + “.vsdx”, SaveFileFormat.VSDX);
diagram.Save(outputDiagramPath + “.vdx”, SaveFileFormat.VDX);
diagram.Save(outputDiagramPath + “.emf”, SaveFileFormat.EMF);
}

Hi Jiaguo,


Thank you for the inquiry.
comingnine:
// How to enable gradient fill here ?
shape.FillStyle??? = GradientFillType.Radial;
shape.FillStyle??? = GradientStyleType.FromCenter;
stops.Add(new DoubleValue(0.0, MeasureConst.Undefined), new ColorValue("#FFFFFF", MeasureConst.Undefined));
stops.Add(new DoubleValue(0.5, MeasureConst.Undefined), new ColorValue("#FF0000", MeasureConst.Undefined));
You can change color and position of a gradient stop as below:
shape.Fill.GradientFill.GradientStops[0].Color = new ColorValue("#FFFFFF", MeasureConst.);
You may also add a gradient stop like:
shape.Fill.GradientFill.GradientStops.Add(new DoubleValue(0.5, MeasureConst.Undefined), new ColorValue("#FF0000", MeasureConst.Undefined));

Furthermore, you can’t set the type, direction and angle properties of a gradient stop. We have logged an enhancement under ticket ID DIAGRAMNET-51109 in our issue tracking system. Your post has also been linked to this ticket. We’ll let you know once it is fixed. We’re sorry for the inconvenience caused.

Hi Jiaguo,


Thank you for being patient. We have a good news for you that the ticket ID DIAGRAMNET-51109 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version 16.12.0 of Aspose.Diagram for .NET API. We’ll inform you via this forum thread as soon as the new release is published.

The issues you have found earlier (filed as DIAGRAMNET-51081;DIAGRAMNET-51109) have been fixed in Aspose.Diagram for .NET 16.12.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan