// 新規ワークブックの作成 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); // 画像の透明度を60%に設定 picture.PictureFormat.Transparency = 0.6; // xlsx ファイルに保存 workbook.Save("PictureTransparency.xlsx");
' 新規ワークブックの作成 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) ' 画像の透明度を60%に設定 picture.PictureFormat.Transparency = 0.6 ' xlsx ファイルに保存 workbook.Save("PictureTransparency.xlsx")