we need to modify the GraphicsPath of several shapes via Aspose.Slides. In older Versions of Aspose.Slides this was possible via Shapes.AddPolyline, but this functionality is missing in more recent versions. Given that the product overview still mentions creating polylines as a graphics & multimedia feature, I assume this should be possible.
Could you please advice on this can be done in Aspose.Slides 14.6? We already tried to modify the GraphicsPath of existing shapes accessible via their ShapeElements, i.e. shape.CreateShapeElements()
But neither changes to GraphicPath.PathData.Points nor adding primitives like GraphicsPath.AddEllipse( 100,100,200,200) is reflected in the saved presentation. It would be great to have working sample code on how this can be done…
I have observed the requirement shared by you and request you to please provide the sample presentation, desired ouput presentation and sample application that worked in Old API. I will try my best to port the code w.r.t to new API in sample application for you to serve the purpose.
thanks for the quick reply! Because the relevant code is trivial, but deeply integrated into the project, I’ll post a code snippet that reproduces the relevant functionality and works with Aspose.Slides 7.8 (see below), but not in more recent versions of Aspose Slides. I attached a sample ppt with the desired output, we need the same functionality to work in pptx, as well.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Slides;
using System.Drawing.Drawing2D;
namespace Test
{
class Program
{
static void Main(string[] args)
{
Aspose.Slides.Presentation p = new Aspose.Slides.Presentation();
Aspose.Slides.ShapeCollection shapes = p.Slides[0].Shapes;
System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
gp.AddBezier(939, 1130, 1495, 1130, 1495, 1479, 2051, 1479);
gp.AddBezier(2051, 1538, 1495, 1538, 1495, 1188, 939, 1188);
gp.AddLine(939, 1188, 939, 1130);
shapes.AddPolyline(939, 1130, 1112, 408, gp);
p.Write("C:\\tmp.ppt");
}
}
}
An issue has been registered in our issue tracking system with issue id: SLIDESNET-35644 for further investigation. Our development team will further check it and as soon as they share their feedback, we will update you via this forum thread.
Thanks for investigating the issue! I already tried working with the GraphicsPath that is accessible via iterating elements returned from CreateShapeElements(), but the changes are not reflected in the saved presentation. I’m looking forward to your suggestions,
After discussion with the
development team, they informed that the feature is not available in the
latest version of Aspose.Slides at the moment. They will further
investigate it (once it is scheduled) to support it. Once the feature is
supported, you will be notified via this forum thread.
The issue is still under investigation at development team’s end. I have requested them to share an ETA once they are done with the investigation. As soon as the information is available, we will update you via this forum thread.
thanks! Would be great to have an ETA. The oxml for the basic functionality is really simple. For our purposes, it would be sufficient to access and change , , , .