API version 4

- ‐

RW

integer

imageWidth

画像の拡大/縮小時の幅を指定します。

resizeプロパティがRESIZE_FREEの場合は、画像の表示サイズはimageWidth、imageHeightプロパティで指定したサイズになります。 resizeプロパティがRESIZE_KEEPRATIO(縦横比固定)の場合は、imageWidth、imageHeightプロパティに指定された値を基準にして自動的にサイズが決定します。

初期値は32です。

関連項目

Label.imageWidthimageimageHeightresize プロパティ



使用例 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;
   }
}