Constant used when setting the media option for components which display images.
Constants Detailed
CROP
Constant used when setting the media option for components which display images.
Makes the image be displayed at its original size. If the component is smaller
than the image, then only a part of the image will show up.
var bigBytes =plugins.file.readFile('d:/big.jpg');var bigImage =solutionModel.newMedia('big.jpg', bigBytes);var smallBytes =plugins.file.readFile('d:/small.jpg');var smallImage =solutionModel.newMedia('small.jpg', smallBytes);var smallLabelWithBigImageCrop =form.newLabel('',130,10,50,50);smallLabelWithBigImageCrop.imageMedia = bigImage;smallLabelWithBigImageCrop.background ='yellow'; smallLabelWithBigImageCrop.mediaOptions =SM_MEDIAOPTION.CROP;var bigLabelWithSmallImageCrop =form.newLabel('',10,290,200,100);bigLabelWithSmallImageCrop.imageMedia = smallImage;bigLabelWithSmallImageCrop.background ='yellow';bigLabelWithSmallImageCrop.mediaOptions = SM_MEDIAOPTION.CROP; // This does not do any cropping actually if the label is larger than the image.
ENLARGE
Constant used when setting the media option for components which display images.
Makes the image be scaled up to fit the size of the component, if the component is
larger than the image. Can be used in combination with KEEPASPECT in order to preserve
the aspect ratio of the image.
It can also be used in combination with REDUCE, to cover all possibilities when
the size of the component is not known upfront.
Constant used when setting the media option for components which display images.
Can be used in combination with REDUCE and/or ENLARGE, to maintain the aspect
ratio of the image while it is scaled down or up.
Constant used when setting the media option for components which display images.
Makes the image be scaled down to fit the size of the component, if the component
is smaller than the image. It can be used in combination with KEEPASPECT in order
to preserve the aspect ratio of the image.
It can also be used in combination with ENLARGE, to cover all possibilities when
the size of the component is not known upfront.