//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; System.IO.Stream stream = this.GetResourceStream("logo.png"); //Create a shape in worksheet GrapeCity.Documents.Excel.Drawing.IShape picture = worksheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 395, 60); //Duplicate picture GrapeCity.Documents.Excel.Drawing.IShape newPicture = picture.Duplicate(); // Save to an excel file workbook.Save("PictureDuplicate.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim stream As IO.Stream = GetResourceStream("logo.png") 'Create a shape in worksheet Dim picture As IShape = worksheet.Shapes.AddPicture(stream, ImageType.PNG, 20, 20, 395, 60) 'Duplicate picture Dim newPicture As IShape = picture.Duplicate() ' save to an excel file workbook.Save("PictureDuplicate.xlsx")