we are using the below sample code to generate a thumbnail image for a pptx file.
private byte[] GeneratePresentationThumbnail(MemoryStream presentationStream, string fileName)
{
byte[] bytes = null;
try
{
Aspose.Slides.License license = new Aspose.Slides.License();
license.SetLicense(“Aspose.Total.lic”);
System.Drawing.Image image = null;
Presentation pres = new Presentation(presentationStream);
ISlide oSlide = pres.Slides[0];
//Getting the thumbnail image of the slide of a specified size
image = oSlide.GetThumbnail(0.5480F, 0.470F);
MemoryStream outStream = new MemoryStream();
image.Save(outStream, System.Drawing.Imaging.ImageFormat.Png);
bytes = outStream.GetBuffer();
outStream.Close();
}
catch (Exception ex)
{
}
return bytes;
}
And able to generate the thumbnail successfully, but if the pptx slide has white/light colors then it has a border line on the top of the thumbnail image and not on other sides.
Please find the attached pptx and the thumbnail image for your reference.