Top  Previous  Next

public Int64 AddShapeByCode(MyCAD owner,String shapeName,MyDrawType drawType,PointF[] thePoints,Single angle,String text)



  Add shape by code, it is useful for automatic drawing. if you want add a image, please use AddImageShapeByCode.



 owner: instance of MyCAD

 shapeName: Shape's name

 drawType: The draw style of a shape

 thePoints: Points array

 angle: The  shape's angle

 text: It is of MyText only,set the text


Return value:

 Return value =-1,add shape unsuccessfully.

 Return value >=0,add shape successfully,the value is the ShapeId of the new shape



 private void menuItem14_Click(object sender, System.EventArgs e)


         PointF[] thePoints = new PointF[2];

         thePoints[0] = new PointF(100,100);

         thePoints[1] = new PointF(200,200);