Aspose.Slides.Examples.CSharp.Shapes.FindShapeInSlide.FindShape C# (CSharp) Method

FindShape() public static method

public static FindShape ( ISlide slide, string alttext ) : IShape
slide ISlide
alttext string
return IShape
        public static IShape FindShape(ISlide slide, string alttext)
        {
            // Iterating through all shapes inside the slide
            for (int i = 0; i < slide.Shapes.Count; i++)
            {
                // If the alternative text of the slide matches with the required one then
                // Return the shape
                if (slide.Shapes[i].AlternativeText.CompareTo(alttext) == 0)
                    return slide.Shapes[i];
            }
            return null;
        }
FindShapeInSlide