public abstract class Shape extends Object
Represents a generic shape.
[C#] // Create a PDf object Pdf pdf1 = new Pdf(); // create a section object and add it to Pdf object 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); // Create GraphInfo object GraphInfo GraphInfo1 = new GraphInfo(); // set the color property for GraphInfo object GraphInfo1.Color = new Aspose.Pdf.Generator.Color("Navy"); // assign the GraphInfo object to shape graph1.Shapes[0].GraphInfo = GraphInfo1; //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) ' Create GraphInfo object Dim GraphInfo1 As GraphInfo = New GraphInfo() ' set the color property for GraphInfo object GraphInfo1.Color = New Aspose.Pdf.Generator.Color("Navy") ' assign the GraphInfo object to shape graph1.Shapes(0).GraphInfo = GraphInfo1 'Save the Pdf pdf1.Save(...) [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Graph Height="100" Width="400"> <Curve Color='blue' Position="0 0 200 80 300 40 350 90"/> </Graph> </Section> </Pdf>
Constructor and Description |
---|
Shape()
Initializes a new instance of the
Shape class. |
Modifier and Type | Method and Description |
---|---|
BlendInfo |
getBlendInfo()
Keeps shape blending parameters
|
Shapes |
getClipShapes()
Gets or sets a
Shapes collection that indicates all clip shapes. |
boolean |
getEndFillArea()
Gets or sets a value that indicates whether shape is closed region.
|
Graph |
getGraph()
Gets or sets shape parent graph.
|
GraphicState |
getGraphicState()
Gets or sets a object that indicates the graphic state for this shape.
|
GraphInfo |
getGraphInfo()
Gets or sets a
GraphInfo object that indicates the graph info,such as color,
line width,etc. |
String |
getID()
Gets or sets a string that indicates the ID of the shape.
|
float |
getOpacity()
Gets or sets a float value between 0.0 and 1.0 that indicates the opacity of the shape.
|
float |
getStrokeOpacity()
Gets or sets a float value between 0.0 and 1.0 that indicates the stroke opacity of the shape.
|
boolean |
isBoundingBoxRelative()
Gets or sets whether shape has bounding box relative size.
|
void |
isBoundingBoxRelative(boolean value) |
void |
setBlendInfo(BlendInfo value) |
void |
setClipShapes(Shapes value) |
void |
setEndFillArea(boolean value) |
void |
setGraph(Graph value) |
void |
setGraphInfo(GraphInfo value) |
void |
setID(String value) |
void |
setOpacity(float value) |
void |
setStrokeOpacity(float value) |
public GraphInfo getGraphInfo()
Gets or sets a GraphInfo
object that indicates the graph info,such as color,
line width,etc.
public void setGraphInfo(GraphInfo value)
public BlendInfo getBlendInfo()
Keeps shape blending parameters
public void setBlendInfo(BlendInfo value)
public String getID()
Gets or sets a string that indicates the ID of the shape.
public void setID(String value)
public boolean getEndFillArea()
Gets or sets a value that indicates whether shape is closed region.
public void setEndFillArea(boolean value)
public GraphicState getGraphicState()
Gets or sets a object that indicates the graphic state for this shape.
GraphicState
public float getStrokeOpacity()
Gets or sets a float value between 0.0 and 1.0 that indicates the stroke opacity of the shape. The default value is 1.0.
public void setStrokeOpacity(float value)
public float getOpacity()
Gets or sets a float value between 0.0 and 1.0 that indicates the opacity of the shape. The default value is 1.0.
public void setOpacity(float value)
public Shapes getClipShapes()
Gets or sets a Shapes
collection that indicates all clip shapes.
public void setClipShapes(Shapes value)
public boolean isBoundingBoxRelative()
Gets or sets whether shape has bounding box relative size.
public void isBoundingBoxRelative(boolean value)
public Graph getGraph()
Gets or sets shape parent graph.
public void setGraph(Graph value)
Copyright © 2016 Aspose. All Rights Reserved.