本文整理汇总了C#中Diagram.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Diagram.Save方法的具体用法?C# Diagram.Save怎么用?C# Diagram.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Diagram
的用法示例。
在下文中一共展示了Diagram.Save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public static void Run()
{
try
{
// ExStart:ExportToSWFWithoutViewer
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Diagrams();
// Instantiate Diagram Object and open VSD file
Diagram diagram = new Diagram(dataDir + "ExportToSWFWithoutViewer.vsd");
// Instantiate the Save Options
SWFSaveOptions options = new SWFSaveOptions();
// Set Save format as SWF
options.SaveFormat = SaveFileFormat.SWF;
// Exclude the embedded viewer
options.ViewerIncluded = false;
// Save the resultant SWF file
diagram.Save(dataDir + "ExportToSWFWithoutViewer_out.swf", SaveFileFormat.SWF);
// ExEnd:ExportToSWFWithoutViewer
}
catch (System.Exception ex)
{
System.Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose License. You can purchase full license or get 30 day temporary license from http:// Www.aspose.com/purchase/default.aspx.");
}
}
示例2: Main
public static void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Path.GetFullPath("../../../Data/");
// 1.
// Exporting VSD to VDX
//Call the diagram constructor to load diagram from a VSD file
Diagram diagram = new Diagram(dataDir + "drawing.vsd");
//Save input VSD as VDX
diagram.Save(dataDir + "outputVSDtoVDX.vdx", SaveFileFormat.VDX);
// 2.
// Exporting from VSD to VSX
// Call the diagram constructor to load diagram from a VSD file
//Save input VSD as VSX
diagram.Save(dataDir + "outputVSDtoVSX.vsx", SaveFileFormat.VSX);
// 3.
// Export VSD to VTX
//Save input VSD as VTX
diagram.Save(dataDir + "outputVSDtoVTX.vtx", SaveFileFormat.VTX);
}
示例3: Run
public static void Run()
{
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Diagrams();
// 1.
// Exporting VSD to VDX
//Call the diagram constructor to load diagram from a VSD file
Diagram diagram = new Diagram(dataDir + "ExportToXML.vsd");
//Save input VSD as VDX
diagram.Save(dataDir + "outputVSDtoVDX.vdx", SaveFileFormat.VDX);
// 2.
// Exporting from VSD to VSX
// Call the diagram constructor to load diagram from a VSD file
//Save input VSD as VSX
diagram.Save(dataDir + "outputVSDtoVSX.vsx", SaveFileFormat.VSX);
// 3.
// Export VSD to VTX
//Save input VSD as VTX
diagram.Save(dataDir + "outputVSDtoVTX.vtx", SaveFileFormat.VTX);
}
示例4: Main
static void Main(string[] args)
{
Aspose.Diagram.License lic = new License();
lic.SetLicense(@"Aspose.Diagram.lic");
Diagram diagram = new Diagram("./../../Samples/Basic Flowchart.vsd");
diagram.Save("./../../Output/Output.vdx", SaveFileFormat.VDX);
diagram.Save("./../../Output/Output.vsx", SaveFileFormat.VSX);
diagram.Save("./../../Output/Output.vtx", SaveFileFormat.VTX);
Console.WriteLine("Done");
Console.ReadKey();
}
示例5: Main
static void Main(string[] args)
{
Aspose.Diagram.License lic = new License();
lic.SetLicense(@"Aspose.Diagram.lic");
Diagram diagram = new Diagram("./../../Samples/Basic Flowchart.vsd");
diagram.Save("./../../Output/Output.png", SaveFileFormat.PNG);
diagram.Save("./../../Output/Output.tiff", SaveFileFormat.TIFF);
diagram.Save("./../../Output/Output.bmp", SaveFileFormat.BMP);
diagram.Save("./../../Output/Output.jpg", SaveFileFormat.JPEG);
Console.WriteLine("Done");
Console.ReadKey();
}
示例6: Main
static void Main(string[] args)
{
//Load diagram
Diagram vsdDiagram = new Diagram("Drawing.vsd");
//Save the diagram as VDX
vsdDiagram.Save("Drawing1.vdx", SaveFileFormat.VDX);
//Save as PDF
vsdDiagram.Save("Drawing1.pdf", SaveFileFormat.PDF);
//Save as JPEG
vsdDiagram.Save("Drawing1.jpg", SaveFileFormat.JPEG);
}
示例7: Run
public static void Run()
{
//ExStart:SaveVisioDiagram
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadSaveConvert();
// load an existing Visio diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// save diagram using the direct path
diagram.Save(dataDir + "SaveVisioDiagram_Out.vsdx", SaveFileFormat.VSDX);
MemoryStream stream = new MemoryStream();
// save diagram in the stream
diagram.Save(stream, SaveFileFormat.VSDX);
//ExEnd:SaveVisioDiagram
}
示例8: Run
public static void Run()
{
// ExStart:SettingCellsInEventSection
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_EventSection();
// Load diagram
Diagram diagram = new Diagram(dataDir + "TestTemplate.vsdm");
// Get page
Aspose.Diagram.Page page = diagram.Pages.GetPage(0);
// Get shape id
long shapeId = page.AddShape(3.0, 3.0, 0.36, 0.36, "Square");
// Get shape
Aspose.Diagram.Shape shape = page.Shapes.GetShape(shapeId);
// Set event cells in the ShapeSheet
shape.Event.EventXFMod.Ufe.F = "CALLTHIS(\"ThisDocument.ShowAlert\")";
shape.Event.EventDblClick.Ufe.F = "CALLTHIS(\"ThisDocument.ShowAlert\")";
shape.Event.EventDrop.Ufe.F = "CALLTHIS(\"ThisDocument.ShowAlert\")";
shape.Event.EventMultiDrop.Ufe.F = "CALLTHIS(\"ThisDocument.ShowAlert\")";
shape.Event.TheText.Ufe.F = "CALLTHIS(\"ThisDocument.ShowAlert\")";
shape.Event.TheData.Ufe.F = "CALLTHIS(\"ThisDocument.ShowAlert\")";
// Save diagram
diagram.Save(dataDir + "SettingCellsInEventSection_out.vsdm", SaveFileFormat.VSDM);
// ExEnd:SettingCellsInEventSection
}
示例9: Main
static void Main(string[] args)
{
string visioStencil = "sample.vss";
// Create a new diagram
Diagram diagram = new Diagram(visioStencil);
//Add a new rectangle shape
long shapeId = diagram.AddShape(
4.25, 5.5, 2, 1, @"Rectangle", 0);
Shape shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Rectangle text."));
//Add a new star shape
shapeId = diagram.AddShape(
2.0, 5.5, 2, 2, @"Star 7", 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Star text."));
//Add a new hexagon shape
shapeId = diagram.AddShape(
7.0, 5.5, 2, 2, @"Hexagon", 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Hexagon text."));
//Save the new diagram
diagram.Save("Drawing1.vdx", SaveFileFormat.VDX);
}
示例10: Run
public static void Run()
{
// ExStart:GlueContainerShape
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Shapes();
// Load diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// Get a particular page
Page page = diagram.Pages.GetPage("Page-1");
// The ID of shape which is glue from Aspose.Diagram.Shape.
long shapeFromId = 779;
// The location on the first connection index where to glue
int shapeToBeginConnectionIndex = 72;
// The location on the end connection index where to glue
int shapeToEndConnectionIndex = 73;
// The ID of shape where to glue to Aspose.Diagram.Shape.
long shapeToId = 743;
// Glue shapes in container
page.GlueShapesInContainer(shapeFromId, shapeToBeginConnectionIndex, shapeToEndConnectionIndex, shapeToId);
// Glue shapes in container using connection name
// Page.GlueShapesInContainer(fasId, "U05L", "U05R", cabinetId1);
// Save diagram
diagram.Save(dataDir + "GlueContainerShape_out.vsdx", SaveFileFormat.VSDX);
// ExEnd:GlueContainerShape
}
示例11: Run
public static void Run()
{
// ExStart:ConnectVisioSubShapes
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Shapes();
// Set sub shape ids
long shapeFromId = 2;
long shapeToId = 4;
// Load diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// Access a particular page
Page page = diagram.Pages.GetPage("Page-3");
// Initialize connector shape
Shape shape = new Shape();
shape.Line.EndArrow.Value = 4;
shape.Line.LineWeight.Value = 0.01388;
// Add shape
long connecter1Id = diagram.AddShape(shape, "Dynamic connector", page.ID);
// Connect sub-shapes
page.ConnectShapesViaConnector(shapeFromId, ConnectionPointPlace.Right, shapeToId, ConnectionPointPlace.Left, connecter1Id);
// Save Visio drawing
diagram.Save(dataDir + "ConnectVisioSubShapes_out.vsdx", SaveFileFormat.VSDX);
// ExEnd:ConnectVisioSubShapes
}
示例12: Run
public static void Run()
{
// ExStart:AddWindowElementInVisio
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_WindowElements();
// Load source Visio diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
// Initialize window object
Window window = new Window();
// Set window state
window.WindowState = WindowStateValue.Maximized;
// Set window height
window.WindowHeight = 500;
// Set window width
window.WindowWidth = 500;
// Set window type
window.WindowType = WindowTypeValue.Stencil;
// Add window object
diagram.Windows.Add(window);
// Save in any supported format
diagram.Save(dataDir + "AddWindowElementInVisio_out.vsdx", SaveFileFormat.VSDX);
// ExEnd:AddWindowElementInVisio
}
示例13: Run
public static void Run()
{
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Diagrams();
string fileName = "LayOutShapesInCompactTreeStyle.vdx";
Diagram diagram = new Diagram(dataDir + fileName);
LayoutOptions compactTreeOptions = new LayoutOptions();
compactTreeOptions.LayoutStyle = LayoutStyle.CompactTree;
compactTreeOptions.EnlargePage = true;
compactTreeOptions.Direction = LayoutDirection.DownThenRight;
diagram.Layout(compactTreeOptions);
diagram.Save(dataDir + "sample_down_right.vdx", SaveFileFormat.VDX);
diagram = new Diagram(dataDir + fileName);
compactTreeOptions.Direction = LayoutDirection.DownThenLeft;
diagram.Layout(compactTreeOptions);
diagram.Save(dataDir + "sample_down_left.vdx", SaveFileFormat.VDX);
diagram = new Diagram(dataDir + fileName);
compactTreeOptions.Direction = LayoutDirection.RightThenDown;
diagram.Layout(compactTreeOptions);
diagram.Save(dataDir + "sample_right_down.vdx", SaveFileFormat.VDX);
diagram = new Diagram(dataDir + fileName);
compactTreeOptions.Direction = LayoutDirection.LeftThenDown;
diagram.Layout(compactTreeOptions);
diagram.Save(dataDir + "sample_left_down.vdx", SaveFileFormat.VDX);
}
示例14: Run
public static void Run()
{
// ExStart:UseSVGSaveOptions
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadSaveConvert();
// Call the diagram constructor to load diagram from a VSD file
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx");
SVGSaveOptions options = new SVGSaveOptions();
// Summary:
// value or the font is not installed locally, they may appear as a block,
// set the DefaultFont such as MingLiu or MS Gothic to show these
// characters.
options.DefaultFont = "MS Gothic";
// Sets the 0-based index of the first page to render. Default is 0.
options.PageIndex = 0;
// Set page size
PageSize pgSize = new PageSize(PaperSizeFormat.A1);
options.PageSize = pgSize;
diagram.Save(dataDir + "UseSVGSaveOptions_out.svg", options);
// ExEnd:UseSVGSaveOptions
}
示例15: Run
public static void Run()
{
// ExStart:CreatingDiagramWithAspose
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_KnowledgeBase();
// Create a new diagram
Diagram diagram = new Diagram(dataDir + "Basic Shapes.vss");
// Add a new rectangle shape
long shapeId = diagram.AddShape(4.25, 5.5, 2, 1, @"Rectangle", 0);
Shape shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Rectangle text."));
// Add a new star shape
shapeId = diagram.AddShape(2.0, 5.5, 2, 2, @"Star 7", 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Star text."));
// Add a new hexagon shape
shapeId = diagram.AddShape(7.0, 5.5, 2, 2, @"Hexagon", 0);
shape = diagram.Pages[0].Shapes.GetShape(shapeId);
shape.Text.Value.Add(new Txt(@"Hexagon text."));
// Save the new diagram
diagram.Save(dataDir + "CreatingDiagramWithAspose_out.vdx", SaveFileFormat.VDX);
// ExEnd:CreatingDiagramWithAspose
}