//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; System.IO.Stream stream = this.GetResourceStream("logo.png"); GrapeCity.Documents.Excel.Drawing.IShape picture = worksheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 790, 120); //Set picture's transparency as 60%. picture.PictureFormat.Transparency = 0.6; // Save to an excel file workbook.Save("PictureTransparency.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim stream = GetResourceStream("logo.png") Dim picture As IShape = worksheet.Shapes.AddPicture( stream, ImageType.PNG, 20, 20, 790, 120) 'Set picture's transparency as 60%. picture.PictureFormat.Transparency = 0.6 ' save to an excel file workbook.Save("PictureTransparency.xlsx")