Hi Team,
I have a PPTX containing one slide having two icons (refer to sample.zip to get the sample.pptx). I am using Aspose Slides for .NET (version 25.3) to get images of these shapes using following code:
using Aspose.Slides;
using Aspose.Slides.Export;
using System.Drawing.Imaging;
class Program
{
static void Main(string[] args)
{
try
{
// Load the presentation
using (Presentation presentation = new Presentation("sample.pptx"))
{
int ix = 0;
foreach (var curShape in presentation.Slides[0].Shapes)
{
if (curShape is GroupShape) {
GroupShape groupShape = curShape as GroupShape;
var curImage = groupShape.GetThumbnail(ShapeThumbnailBounds.Slide, (float)2, (float)2);
curImage.Save($"C:\\Users\\dummy\\Downloads\\shape{ix}.png", System.Drawing.Imaging.ImageFormat.Png);
ix++;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
}
One image comes out correctly, but other image is not same as the one contained in the PPTX slide. Can you help me understand why this icon image is not generated correctly ? Thank you for helping.
Regards,
Bhavana
shape0.png (17.0 KB)
shape1.png (17.9 KB)
sample.zip (45.8 KB)