public SCImage FromSlidePart(SlidePart slidePart, OpenXmlCompositeElement compositeElement) { P.Shape pShape = (P.Shape)compositeElement; A.BlipFill aBlipFill = pShape.ShapeProperties.GetFirstChild <A.BlipFill>(); SCImage backgroundImage = TryFromBlipFill(slidePart, aBlipFill); return(backgroundImage); }
internal SlidePicture( SCSlide slide, string blipRelateId, ShapeContext spContext, P.Picture pPicture) : base(slide, pPicture) { Image = new SCImage(Slide.SlidePart, blipRelateId); Context = spContext; }
public void Background_ImageIsNull_WhenTheSlideHasNotBackground() { // Arrange ISlide slide = _fixture.Pre009.Slides[1]; // Act SCImage backgroundImage = slide.Background; // Assert backgroundImage.Should().BeNull(); }
private static SCImage TryFromBlipFill(SlidePart slidePart, A.BlipFill aBlipFill) { SCImage backgroundImage = null; var blipRelateId = aBlipFill?.Blip?.Embed?.Value; // try to get blip relationship ID if (blipRelateId != null) { backgroundImage = new SCImage(slidePart, blipRelateId); } return(backgroundImage); }
public SCImage FromSlidePart(SlidePart slidePart) { SCImage backgroundImage = null; P.Background pBackground = slidePart.Slide.CommonSlideData.Background; if (pBackground != null) { A.BlipFill aBlipFill = pBackground.Descendants <A.BlipFill>().SingleOrDefault(); backgroundImage = TryFromBlipFill(slidePart, aBlipFill); } return(backgroundImage); }