Syncfusion.XlsIO.Base
Example 


Picture Property (IOleObject)

Gets or sets the picture.
Syntax
'Declaration
 
ReadOnly Property Picture As Image
'Usage
 
Dim instance As IOleObject
Dim value As Image
 
value = instance.Picture
Image Picture {get;}

Property Value

The picture.
Example
The following code illustrates how to access Picture property.
using Syncfusion.XlsIO;
using System;
using System.Drawing;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Create image stream
            Image image = Image.FromFile("image.png");
            
            //Add ole object
            IOleObject oleObject = worksheet.OleObjects.Add("Shapes.xlsx", image, OleLinkType.Embed);
            
            //Get picture's height and width
            Console.WriteLine(oleObject.Picture.Height);
            Console.WriteLine(oleObject.Picture.Width);
            
            //Save and dispose
            workbook.SaveAs("OLEObjects.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//{Given image's height}
//{Given image's width}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also