Excel for UWP/WinRT
XLPictureShape コンストラクタ(WriteableBitmap,Rect)
使用例 

新しい XLPictureShape に格納されている画像。
セルに対する画像のサイズおよび位置を 指定する四角形(ツイップ単位)。
XLPictureShape の新しいインスタンスを初期化します。
構文
'宣言
 
Public Function New( _
   ByVal img As Windows.UI.Xaml.Media.Imaging.WriteableBitmap, _
   ByVal rc As Windows.Foundation.Rect _
)
public XLPictureShape( 
   Windows.UI.Xaml.Media.Imaging.WriteableBitmap img,
   Windows.Foundation.Rect rc
)

パラメータ

img
新しい XLPictureShape に格納されている画像。
rc
セルに対する画像のサイズおよび位置を 指定する四角形(ツイップ単位)。
使用例
下のコードはセルに画像を追加します。画像は、セルの中央にある 60 ツイップ幅のエッジで囲まれた 四角形内に描画されます。
// シートとセルを取得します
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);

// XLPictureShape をセルに割り当てます
cell.Value = pic;
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

参照

関連項目

XLPictureShape クラス
XLPictureShape メンバ
オーバーロード一覧

Send Feedback