API version 4

- ‐

RW

CRS::Common::UI::Image

image

ラベルに表示する画像を設定します。

画像ファイルの形式はBMP, GIF(アニメーションGIFを含む), JPEG、PNG(透過PNGを含む)、SVG(SVG Tiny 1.2規格)などのイメージファイルに対応しています。
Image オブジェクトの他、画像を示すURLや画像データを保持するreadableオブジェクトを指定できます。
初期値はnullです。

関連項目

Label.imageimageHeightimageWidthresize プロパティ

readableオブジェクト、writableオブジェクト



使用例 CRSダウンロード ダウンロード(ImageField_sample.png)

Form formImageField {
   x = 0; y = 0; width = 800; height = 600;
   PrintForm printform1 {
           x = 10; y = 72; width = 256; height = 362;

           ImageField imagefield_horizontalAlign[3] {
                   x = 8; y = 8; width = 72; height = 32; layout = LAYOUT_HORIZONTAL; layoutSpacing = 8; border = BORDER_PLANE;
                   image = "ImageField_sample.png";
                   imageWidth = 40; imageHeight = 20; resize = RESIZE_FREE;
                   imagefield_horizontalAlign[0].horizontalAlign = ALIGN_LEFT;
                   imagefield_horizontalAlign[1].horizontalAlign = ALIGN_CENTER;
                   imagefield_horizontalAlign[2].horizontalAlign = ALIGN_RIGHT;
           }
           ImageField imagefield_verticalAlign[3] {
                   x = 8; y = 48; width = 72; height = 32; layout = LAYOUT_HORIZONTAL; layoutSpacing = 8; border = BORDER_PLANE;
                   image = "ImageField_sample.png";
                   imageWidth = 40; imageHeight = 20; resize = RESIZE_FREE;
                   imagefield_verticalAlign[0].verticalAlign = ALIGN_TOP;
                   imagefield_verticalAlign[1].verticalAlign = ALIGN_MIDDLE;
                   imagefield_verticalAlign[2].verticalAlign = ALIGN_BOTTOM;
           }

           TextField textfield_resize[3] {
                   x = 8; y = 88; width = 200; height = 16; layoutSpacing = 72;
                   textfield_resize[0].value = "RESIZE_STD";
                   textfield_resize[1].value = "RESIZE_KEEPRATIO";
                   textfield_resize[2].value = "RESIZE_FREE";
           }
           ImageField imagefield_resize[3] {
                   x = 24; y = 104; width = 200; height = 72; layoutSpacing = 16; border = BORDER_PLANE;
                   image = "ImageField_sample.png";
                   imageWidth = width;
                   imageHeight = height;
                   imagefield_resize[0].resize = RESIZE_STD;
                   imagefield_resize[1].resize = RESIZE_KEEPRATIO;
                   imagefield_resize[2].resize = RESIZE_FREE;
           }
   }
   Button buttonPrint {
           x = 8; y = 8; width = 56; height = 24; title = "印刷";
           function onTouch(e) {
                   ^.printpreview1.clearPages();
                   ^.printpreview1.document = ^.printform1.printDocument();
           }
   }
   PrintPreview printpreview1 {
           x = 272; y = 8; width = 488; height = 472;
   }
}