Creates a new shape object.
[Visual Basic]Overloads Public Sub New( _
ByVal
doc As
Document, _
ByVal
shapeType As
ShapeType _
)
Parameters
- doc
- The owner document.
- shapeType
- The type of the shape to create.
Remarks
You should specify desired shape properties after you created a shape.
Example
Shows how to create and add an image to a document without using document builder.
[C#]
Document doc = new Document();
Shape shape = new Shape(doc, ShapeType.Image);
shape.ImageData.SetImage(MyDir + "Hammer.wmf");
shape.Width = 100;
shape.Height = 100;
doc.FirstSection.Body.FirstParagraph.AppendChild(shape);
doc.Save(MyDir + "Image.CreateImageDirectly Out.doc");
[Visual Basic]
Dim doc As Document = New Document()
Dim shape As Shape = New Shape(doc, ShapeType.Image)
shape.ImageData.SetImage(MyDir & "Hammer.wmf")
shape.Width = 100
shape.Height = 100
doc.FirstSection.Body.FirstParagraph.AppendChild(shape)
doc.Save(MyDir & "Image.CreateImageDirectly Out.doc")
See Also
Shape Class | Aspose.Words.Drawing Namespace