/// <summary> /// Inserts a picture at the end of the text in the header or footer /// </summary> /// <param name="Picture">The image object containing the Picture</param> /// <param name="Alignment">Alignment. The image object will be inserted at the end of the Text.</param> public ExcelVmlDrawingPicture InsertPicture(Image Picture, PictureAlignment Alignment) { string id = ValidateImage(Alignment); //Add the image #if (NETSTANDARD) var img = ImageCompat.GetImageAsByteArray(Picture); #else ImageConverter ic = new ImageConverter(); byte[] img = (byte[])ic.ConvertTo(Picture, typeof(byte[])); #endif var ii = _ws.Workbook._package.AddImage(img, ExcelPicture.GetImageCodecInfo(Picture)); return(AddImage(Picture, id, ii)); }