public class PositionArray extends Object
Encapsulates a position array used in the Line
.
[C#] //Instantiate a Pdf document object Pdf pdf1 = new Pdf(); //Add a section to the Pdf document Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); //Create a graph object in the section with Width=100 and Height=400 Graph graph1 = new Graph(sec1,100,400); //Add the graph object to the paragraphs collection of the section sec1.Paragraphs.Add(graph1); //Create an array containing the (X,Y) values of 4 control points //required to position a curve float[] posArr = new float[]{0,0,200,80,300,40,350,90}; //Create a curve in the graph with the coordinates given as an array to //the constructor of curve class Curve curve1 = new Curve(graph1,posArr); //Add the curve shape into the shapes collection of the graph graph1.Shapes.Add(curve1); //Save the Pdf pdf1.Save(@"d:/pdftest/PositionArrayTest.pdf"); [Visual Basic] 'Instantiate a Pdf document object Dim pdf1 As Pdf = New Pdf() 'Add a section to the Pdf document Dim sec1 As Section = pdf1.Sections.Add() 'Create a graph object in the section with Width=100 and Height=400 Dim graph1 As Graph = New Graph(sec1, 100, 400) 'Add the graph object to the paragraphs collection of the section sec1.Paragraphs.Add(graph1) 'Create an array containing the (X,Y) values of 4 control points 'required to position a curve Dim posArr() As Single = New Single() {0, 0, 200, 80, 300, 40, 350, 90} 'Create a curve in the graph with the coordinates given as an array to 'the constructor of curve class Dim curve1 As Curve = New Curve(graph1, posArr) 'Add the curve shape into the shapes collection of the graph graph1.Shapes.Add(curve1) 'Save the Pdf pdf1.Save("d:/pdftest/PositionArrayTest.pdf") [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Graph Height="100" Width="400"> <Curve Position="0 0 200 80 300 40 350 90" /> </Graph> </Section> </Pdf>
Modifier and Type | Field and Description |
---|---|
float[] |
posArr
The position array.
|
Constructor and Description |
---|
PositionArray() |
public int getLength()
Represents an int value that indicates the length of the position array. It should be equal to or greater than 4.
public void setLength(int value)
public float get_Item(int index)
Gets or sets the specified value in terms of index.
public void set_Item(int index, float value)
Copyright © 2016 Aspose. All Rights Reserved.