OfficeOpenXml.ExcelHeaderFooterText.InsertPicture C# (CSharp) Method

InsertPicture() public method

Inserts a picture at the end of the text in the header or footer
public InsertPicture ( Image Picture, PictureAlignment Alignment ) : OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingPicture
Picture Image The image object containing the Picture
Alignment PictureAlignment Alignment. The image object will be inserted at the end of the Text.
return OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingPicture
        public ExcelVmlDrawingPicture InsertPicture(Image Picture, PictureAlignment Alignment)
        {
            string id = ValidateImage(Alignment);

            //Add the image
            ImageConverter ic = new ImageConverter();
            byte[] img = (byte[])ic.ConvertTo(Picture, typeof(byte[]));
            var ii = _ws.Workbook._package.AddImage(img);

            return AddImage(Picture, id, ii);
        }

Same methods

ExcelHeaderFooterText::InsertPicture ( FileInfo PictureFile, PictureAlignment Alignment ) : OfficeOpenXml.Drawing.Vml.ExcelVmlDrawingPicture