Code is as follows:
- Code: Select all
string outPutDirectory = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
string logoUrl = Path.Combine(outPutDirectory, "Content\\images\\logo.png");
IAutoShape shapeLogo = firstSlide.Shapes.AppendShape(ShapeType.Rectangle, rectLogo);
FormatPicture(shapeLogo, logoUrl, 0);
private void FormatPicture(IAutoShape shape, string pictureUrl, int transparency)
{
shape.Fill.FillType = FillFormatType.Picture;
shape.Fill.PictureFill.Picture.Url = pictureUrl;
shape.Fill.PictureFill.FillType = PictureFillType.Stretch;
shape.ShapeStyle.LineColor.Color = Color.Transparent;
shape.Fill.PictureFill.Picture.Transparency = transparency;
}
I have verified on Ms Azure and the image is very well present at
D:\home\site\wwwroot\Content\images\logo.png
Is there any way to set shape.Fill.PictureFill.Picture to take an image from Resources instead of providing the filePath?
This is very urgent and any help will be greatly appreciated.
Thanks and Regards