C1.Xaml.Excel アセンブリ > C1.Xaml.Excel 名前空間 > XLPictureShape クラス > XLPictureShape コンストラクタ : XLPictureShape コンストラクタ(WriteableBitmap,Int32,Int32,Int32,Int32) |
// シートとセルを取得します XLSheet sheet = c1ExcelBook1.Sheets[0]; XLCell cell = sheet[row, col]; // ピクチャの大きさを調整するためにセルサイズを計算します Rectangle rc = new Rectangle(0, 0 sheet.Columns[col].Width, sheet.Rows[row].Height); // 60 ツイップのエッジを追加します rc.Inflate(-60, -60); // XLPictureShape を作成します XLPictureShape pic = new XLPictureShape(image, rc.X, rc.Y, rc.Width, rc.Height); // XLPictureShape をセルに割り当てます cell.Value = pic;