Syncfusion.XlsIO.Base
Example 


Picture file name.

AddPicture(String) Method

Adds IPictureShape from the specified file to the IPictures collection.
Syntax
'Declaration
 
Overloads Function AddPicture( _
   ByVal strFileName As String _
) As IPictureShape
'Usage
 
Dim instance As IPictures
Dim strFileName As String
Dim value As IPictureShape
 
value = instance.AddPicture(strFileName)

Parameters

strFileName
Picture file name.

Return Value

Added picture.
Remarks
This method is only supported in Windows Forms, WPF, ASP.NET and ASP.NET MVC.
Example
The following code illustrates how to add a IPictureShape from the specified file to the IPictures collection.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Add image
            IPictureShape picture = worksheet.Pictures.AddPicture("Image.png");
            
            //Save and dispose
            workbook.SaveAs("Shapes.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also