Hi Team,
I have a PPTX (attached) with two slides. Each slide has a shape with a bullet. When I try to get image of these shapes, I see that the color of the bullet is red instead of black. The code I used:
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"))
{
// Get the first slide as an image
// using (var img = presentation.Slides[0].GetThumbnail(1, 1))
// {
// // Save the image
// img.Save("output.png", System.Drawing.Imaging.ImageFormat.Png);
// Console.WriteLine("Image saved successfully as output.png");
// }
int shapeCounter = 1;
// Loop through all slides
for (int slideIndex = 0; slideIndex < presentation.Slides.Count; slideIndex++)
{
// Get current slide
ISlide slide = presentation.Slides[slideIndex];
// Process each shape in the current slide
foreach (var curShape in slide.Shapes)
{
using (var curImage = curShape.GetImage())
{
// Save the image with a unique name including slide number
string fileName = $"slide_{slideIndex + 1}_shape_{shapeCounter}.png";
curImage.Save(fileName, Aspose.Slides.ImageFormat.Png);
Console.WriteLine($"Image saved successfully as {fileName}");
shapeCounter++;
}
}
}
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
}
slide_1_shape_1.png (6.0 KB)
slide_2_shape_2.png (5.5 KB)
I used Aspose version 25.5. Pls fine attached the output for the two slides as well.
Could you pls help me resolve this issue ? Thank you,
@bhav
sample.zip (32.5 KB)