How to Check If Shadows Are Enabled on Image Using Aspose.Slides for .NET?

We are using
Aspose.Slides .NET and are running it on windows 10 .NET 4 ?

Does aspose.slides completely support shadow on images ?
Is there an API to check if a current shape has shadow applied on it?
what are the return values?
Will it be available for all shapes ?

Regards,
Raman

@sraman,

Aspose.Slides for .NET supports to get/set Shadow effects for shapes and wordarts, see the documents for your reference.
https://docs.aspose.com/slides/net/shape-effect/
https://docs.aspose.com/slides/net/wordart/

Also, see the sample code segment for your reference.
e.g.,
Sample code:

// Load the presentation
Aspose.Slides.Presentation presentation = new Aspose.Slides.Presentation("presentation.pptx");

// Access the first slide
Aspose.Slides.ISlide slide = presentation.Slides[0];

// Get the first shape on the slide
Aspose.Slides.IAutoShape shape = (IAutoShape)slide.Shapes[0];

// Assuming shape is your Shape object
if (shape != null)
{
   if (shape.TextFrame != null)
    {
        foreach (var paragraph in shape.TextFrame.Paragraphs)
        {
            foreach (var portion in paragraph.Portions)
            {
                if (portion.PortionFormat.EffectFormat.OuterShadowEffect != null)
                {
                    // Shadow is applied to this portion of text
                    // Your code goes here
                }
            }
        }
    }
    else if (shape.EffectFormat.OuterShadowEffect != null)
    {
        // Shadow is applied to the shape
        // Your code goes here
    }
}

Hope, this helps a bit.

Hi Amjad,

Thanks for the reply, could you answer the following questions

  1. All the shadow effects in microsoft powerpoint are supported by Aspose.Slides
  2. if at all any shadow is applied on the shape, shape.EffectFormat.OuterShadowEffect would be the place to detect that.

Regards,
Raman

@sraman,

  1. Yes, shadow effects (which are supported in Microsoft PowerPoint) are mostly supported by Aspose.Slides.

  2. Generally, this will work for the intended purpose.

In case you find any issues, please let us know with sample file(s) and sample (runnable) code, and we will check it soon.