How extract background to image file?

I want extract background to image with c# aspose. How make it?

931219.zip (593.9 KB)

image.png (94.9 KB)

@mesteruh,

I have observed your requirements and have not been able to completely understand them in image. Can you please confirm, if you want to extract the following master shape in on your end?

If this is requirement then its a shape not an image. Can you please elaborate your requirements.

lowest layer. gray and white - without text

@mesteruh,

The layer you are referring is a shape and not an image inside. However, Aspose.Slides allow you to access any shape and make image of that.

 public static void GenShapeThumb()
{
  
    // Instantiate a Presentation class that represents the presentation file
    using (Presentation presentation = new Presentation( "HelloWorld.pptx"))
    {
        // Create a full scale image
        using (Bitmap bitmap = presentation.MasterHandoutSlideManager.MasterHandoutSlide.Shapes[0].GetThumbnail())
        {
            // Save the image to disk in PNG format
            bitmap.Save( "Shape_thumbnail_out.png", ImageFormat.Png);
        }
    }

}

its not working with my sample

@mesteruh,

Please try using following alternate sample code on your end. I hope this will suffice.

public static void GenShapeThumb()
{
    String path = @"C:\Aspose Data\931219\";
    // Instantiate a Presentation class that represents the presentation file
    using (Presentation presentation = new Presentation(path + "931219.ppt"))
    {
        // Create a full scale image
    //    using (Bitmap bitmap = presentation.Masters[0].Shapes[0].GetThumbnail())
        ILayoutSlide layout = presentation.Slides[0].LayoutSlide;

        //YOUR DESIRED INDEX IS i=1;
        for (int i = 0; i < layout.Shapes.Count; i++)
        {
            using (Bitmap bitmap = layout.Shapes[i].GetThumbnail())
            {
                // Save the image to disk in PNG format
                bitmap.Save(path + "Shape_thumbnail_"+(i+1).ToString()+".png", ImageFormat.Png);
            }
        }
    }

}