【セル型】イメージ型セルで画像のサイズを指定したい
対象製品
SPREAD for .NET 2.5J Web Forms Edition
詳細
次の様にCSS(Cascade Style Sheet)を用いることで可能です。
【VB サンプルコード】
【C# サンプルコード】
【VB サンプルコード】
------------------------------------
Webフォームクラス
------------------------------------
Dim i As New FarPoint.Web.Spread.ImageCellType
i.ImageUrl = "/img/testimage.gif"
i.CssClass = "test"
FpSpread1.Columns(0).CellType = i
------------------------------------
HTML
------------------------------------
セルのサイズに合わせる例
<style type="text/css">
.test img {
width: 100%;
height: 100%;
}
</style>
固定して表示する例
<style type="text/css">
.test img {
width: 100px;
height: 100px;
}
</style>
Webフォームクラス
------------------------------------
Dim i As New FarPoint.Web.Spread.ImageCellType
i.ImageUrl = "/img/testimage.gif"
i.CssClass = "test"
FpSpread1.Columns(0).CellType = i
------------------------------------
HTML
------------------------------------
セルのサイズに合わせる例
<style type="text/css">
.test img {
width: 100%;
height: 100%;
}
</style>
固定して表示する例
<style type="text/css">
.test img {
width: 100px;
height: 100px;
}
</style>
【C# サンプルコード】
------------------------------------
Webフォームクラス
------------------------------------
FarPoint.Web.Spread.ImageCellType i = new FarPoint.Web.Spread.ImageCellType();
i.ImageUrl = "/img/testimage.gif";
i.CssClass = "test";
FpSpread1.Columns[0].CellType = i;
------------------------------------
HTML
------------------------------------
「VB サンプルコード」に掲載したものと同様です。
Webフォームクラス
------------------------------------
FarPoint.Web.Spread.ImageCellType i = new FarPoint.Web.Spread.ImageCellType();
i.ImageUrl = "/img/testimage.gif";
i.CssClass = "test";
FpSpread1.Columns[0].CellType = i;
------------------------------------
HTML
------------------------------------
「VB サンプルコード」に掲載したものと同様です。
キーワード
外観 セル型 一般
この文書は、以前は次のFAQ IDで公開されていました : 9916