Group: Forum Members
Last Active: 13 Years Ago
Posts: 7,
Visits: 1
|
Hi, I am using the Visio Shape Importer and have successfully imported some shapes from a VSX file. I can see that the imported shapes have the FillStyle (shape.Style.FillStyle) properly set to NGradientFillStyle. I have attempted to change the BeginColor of the gradient fill, but the shapes are not changing color. The setting of the Location, Text, and ShadowStyle properties of the shape are working.
Here is my code:
lib.RemoveAllChildren(); NVisioImporter visioImporter = new NVisioImporter(lib); visioImporter.Import(string.Format("{0}\\{1}", Application.StartupPath, "tasks.vsx"));
float left = 10; int numNodes = lib.ChildrenCount(new Nevron.Filters.NInstanceOfTypeFilter(typeof(NMaster))); for ( int idx = 0; idx < numNodes; idx++ ) { NMaster master = (NMaster)lib.GetChildAt(idx); Nevron.Dom.NNodeList node = master.CreateInstance(doc, new NPointF(0,0)); NShape shape = node[0] as NShape; shape.Style.ShadowStyle = new NShadowStyle(ShadowType.GaussianBlur, Color.Gray, new NPointL(3.0f, 3.0f)); NGradientFillStyle fillStyle = shape.Style.FillStyle as NGradientFillStyle; shape.Style.FillStyle = new NGradientFillStyle(fillStyle.Style, fillStyle.Variant, Color.FromArgb(255, 120, 148, 64), fillStyle.EndColor); shape.Location = new NPointF(left, 10); left += 10 + shape.Width; shape.Text = string.Format("{0}", master.Name); }
|