We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Overlapping elements wrongly included in GetThumbnail

I have been using Slides for a long time. Up to and including version 5.0, I could take thumbnails of just one or two elements perfectly. If something else was on top of the elements, that something was excluded from the snapshot. (See attachments whose names end "alone" - these were generated with 5.0 and are just what I want.)

But versions after that, right up to 7.0, include the overlapping element in the snapshot. (See attachments whose names end overlap - these were generated with 7.0 from the exact same .ppt as the "alone ones.")

I really need this functionality. Is there any plan to fix it back to how it was in 5.0?

Hi Kate,


We are sorry for your inconvenicne.

Can you please share the sample presentation along with the code sample used for further investigation on my end. I will try my best to help you further in this regard.

Many Thanks,

Sure, here is the deck

Hi Kate,


I have worked with the presentation file shared by you and have generated slide thumbnails using Aspose.Slides for .NET 7.0.0. I have used following sample code for my investigation. Please share, if I may help you further in this regard.


public static void PptThumbnail(String path, String file)
{
Presentation pres = new Presentation(path + file);

for (int i = 1; i <= pres.Slides.LastSlidePosition; i++)
{
try
{
System.Drawing.Image thumbBitmap = pres.GetSlideByPosition(i).GetThumbnail(2, 2);
thumbBitmap.Save(path + “Slides//Slide_” + i.ToString() + “.png”, System.Drawing.Imaging.ImageFormat.Png);
}
catch (Exception e)
{
Console.WriteLine(“Slide :” + i.ToString() + " has problem in thumbnail generation");
Console.WriteLine(e.StackTrace);
}
}

}


Many Thanks,

That just takes a thumbnail of the whole slide. I don't want that. I want just specific elements. The call is the same for both 5.0 and 7.0:

System.Drawing.Bitmap thumbnail =
(System.Drawing.Bitmap)slide.GetThumbnail(elementsToDraw,
ShrinkIfTooWide(imageSize), window);

elementsToDraw is a collection of elements (shapes) - either just the bullets in the "Vertical bullets" images or the arrow in the "arrow" images. In 5.0 if you ask for just the bullets you get just the bullets; in 7.0 the same code gets you bullets with the arrow in front of them. In 5.0 if you ask for just the arrow you get just the arrow; in 7.0 you get the arrow with some of the bullet text showing behind (it's white on white so it's hard to see, but it's there.)

This change in the behaviour of GetThumbnail (the overload that takes a collection) happened in version 5.1 I believe, possibly 5.2. I would like it to go back to how it worked in 5.0.

Hi Kate,


Please find the attached shape thumbnails that I have generated with Aspose.Slides for .NET 7.0.0 using following sample.

public static void generatePPTShapeThumb(String path, String file)
{

//Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation(path + file);

//Accessing a slide using its slide position
// Slide slide = pres.GetSlideByPosition(1);

for (int j = 1; j <= pres.Slides.LastSlidePosition; j++)
{
Slide slide = pres.GetSlideByPosition(j);

//Iterate all shapes on a slide and create thumbnails

Shapes shapes = slide.Shapes;
for (int i = 0; i < shapes.Count; i++)
{
Shape shape = shapes[i];

//Getting the thumbnail image of the shape
Image img = slide.GetThumbnail(new object[] { shape }, 1.0, 1.0, shape.ShapeRectangle);

//Saving the thumbnail image in gif format
img.Save(path + “Slides//Slide_” + j + “Shape” + i + “.jpeg”, ImageFormat.Jpeg);

}


}
}

Can you please highlight the issue or your requirement in these thumbnails so that I may add them as issue our issue tracking system. Please also share the desired output for reference and comparison.

Many Thanks,

Thankyou yes I already have the code to do what I want - it's similar to what you just posted. And with version 5.0 it does just what I want. It produces the attachments from my first post with the word "alone" in their names that include just the element I ask for. But in 7.0 and up the images include images of other elements that I didn't ask for.

Did you run that code you just provided me against the deck I provided you? And if you did, for the images of the bullets with the arrow in front of them (or the arrow with the bullets behind them) did you get a pure image with just the element you asked for, or the mixed images like I attached to my first post? If you got the pure images then I will try to see what is the difference between your code and mine.

Hi Kate,


I have observed the issue specified and thankyou for the clarification. An issue with ID SLIDESNET-33954 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Has there been any movement on this issue?

Hi Kate,

I have observed the issue status from our issue tracking system and regret to share that the issue is still unresolved. I have raised the priority of the issue and have requested our development team to kindly schedule and resolve the issue. I will be able to share the further information in this regard with you as soon as it will be shared by our development team.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-33954) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.