Am evaluating Aspose.Slide for Java and is trying to create Shape thumbnail image(jpeg).
For this , am using the getThumbnail method as advised in this wiki link:
But what i get is only blank white images. Please look into this and provide a solution.
I have attached the Java code which shows how to include certain shapes in the thumbnail image of slide.
In my example code, I am taking the thumbnail image of slide which has different shapes, but I want to render only circles in the output image.
The idea behind is to implement IDrawingControl interface, which has the checkObject method.
The Slide.getThumbnail calls this method for each shape, if you say yes, it will draw in thumbnail, if you say no, it will not draw it.
So whatever shape you want to draw, save it in your list (in my case I used HashMap) and during the checkObject, if it is in your list, then return DRAW else return IGNORE
For clarification, please see the attached code.
I have also included the source presentation used in this code and output thumbnail image for you to view.
Thanks for your code . I believe i did not make my requirement clear.
Using your code we can generate the image of the slide with desired
shapes. My requirement is to convert the shape to image directly i.e
get a rectangle shape as a JPEG image. Can this be done ?
Thanks for the code. Am able to convert the shapes to images. but the converted image is not transparent i.e it contains a white background. What are the options i should set to get a transparent image ?
No, it is not possible, you cannot get image of shape with transparent background. Image of single shape is just a region of the whole slide so it also has white background.