How to change the polygon tip point and also custom all point for this shape

// Create a new shape
Aspose.Cells.Drawing.Shape polygonShape = xlWorkSheet.Shapes.AddAutoShape(Aspose.Cells.Drawing.AutoShapeType.RoundedRectangularCallout, 0, 0, 0, 0, 0, 0);

polygonShape.Y = 200; //Shape Top properties
polygonShape.X = 500; //Shape Left properties
polygonShape.Width = 200; // Shape Width
polygonShape.Height = 100; // Shape Height

@pixihi,

Could you please provide more details about your requirements. Give us some screenshots to demonstrate your needs. Also, please create your desired shape in MS Excel manually, save the Excel file and provide us here, we will check on how to do it via Aspose.Cells APIs.

PS. please zip the Excel file prior attaching here.

Aspose.Cells Functionality.zip (70.7 KB)

@pixihi,

Thanks for the sample file.

We checked your Excel file with screenshots/details and noted your requirements and issues you mentioned. We will check on how to directly modify individual connection points or the vertices of the shapes in code via Aspose.Cells APIs. We may enhance the APIs and provide example code snippets to cope with your issues and accomplish your tasks.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver code snippets or fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-56854

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@pixihi,

Please note, the RoundedRectangularCallout type of shape usually has three adjustment points. The following sample code shows how to adjust it.

// Create a new workbook
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

// Add a button to the worksheet
Shape polygonShape = sheet.Shapes.AddAutoShape(AutoShapeType.RoundedRectangularCallout, 0, 0, 0, 0, 0, 0);

polygonShape.Y = 200; //Shape Top properties
polygonShape.X = 500; //Shape Left properties
polygonShape.Width = 200; // Shape Width
polygonShape.Height = 100; // Shape Height

ShapeGuideCollection shapeGuides = polygonShape.Geometry.ShapeAdjustValues;
shapeGuides.Add("adj1", 1.02167d); //The distance between the tip point and the center point, with negative values ​​on the left and positive values ​​on the right. Its value is usually the ratio of the half-width.
shapeGuides.Add("adj2", -0.295d);  //The distance between the tip point and the center point, negative for upwards and positive for downwards. Its value is usually a ratio of the half-height.
shapeGuides.Add("adj3", 0.16667d); //Usually the default value

We hope it helps you. If you encounter any problems, please feel free to write us back.

Thank you so much for your support. It has been very helpful for my project, and you have saved me lots of time. So thank you again.

@pixihi,

You are welcome. Please feel free to write us back if you have further queries or comments.

yes one more query regarding these shapes inside text set vertical orientation

@pixihi
Could you share a template file to show details about your about “text set vertical orientation”

Sample.zip (182.2 KB)

in the above Excel file rectangle shape inside the text direction how to set eject as vertical only

@pixihi
Please try the following codes:

  Workbook workbook = new Workbook();
  workbook.Worksheets[0].TextBoxes.Add(0, 0, 100, 100);
  Shape shape = workbook.Worksheets[0].Shapes[0];
  shape.Text = "Test";
  shape.TextOrientationType = TextOrientationType.ClockWise;

this will try but when set as TextOrientationType.ClockWise that case Japanese text also rotated 90deg that’s a problem.

@pixihi

  shape.TextOrientationType = TextOrientationType.ClockWise;
  shape.TextBody.TextAlignment.TextVerticalType = Aspose.Cells.Drawing.Texts.TextVerticalType.Vertical;

The settings on Excel view are different from stored in the Excel.
We logged an issue CELLSNET-56857

This will work properly.

Thank you so much for your support.

Also, one more question how to create a Freefrom line shape using multiple nods point?

image.png (67.9 KB)

image.png (42.8 KB)

@pixihi
The following codes is used to create a rectangle.

Workbook workbook = new Workbook();
 int w = 200;//px;
 int h = 200;//px
 workbook.Worksheets[0].Shapes.AddAutoShape(AutoShapeType.NotPrimitive, 1, 0,1,0, w, h);


 Shape shape = workbook.Worksheets[0].Shapes[0];
 shape.Fill.FillType = FillType.None;
 CustomGeometry custom = (CustomGeometry)shape.Geometry;
 ShapePath p = (ShapePath)custom.Paths[ custom.Paths.Add()];
 ShapeSegmentPath pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.MoveTo)];
 pathSegement.Points.Add(0, 0);


 double pxToEmu = 72 / 96.0 * 12700;
// the coordinate is [with*pxToEmu , height *pxToEmu ]
 pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];     

 pathSegement.Points.Add(0, 0);
 pathSegement.Points.Add((int)(w * pxToEmu),0);

 pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];          
 pathSegement.Points.Add((int)(w * pxToEmu), 0);
 pathSegement.Points.Add((int)(w * pxToEmu), (int) (h  * pxToEmu));

 pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];
 pathSegement.Points.Add((int)(w * pxToEmu), (int)(h * pxToEmu));
 pathSegement.Points.Add((int)0, (int)(h * pxToEmu));


 pathSegement = p.PathSegementList[p.PathSegementList.Add(ShapePathType.LineTo)];
 pathSegement.Points.Add((int)0, (int)(h * pxToEmu));
 pathSegement.Points.Add(0, 0);

 workbook.Save(dir + "dest.xlsx");