Child pages
  • MEDIAOPTION

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hiddendiv:style=display:none}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACTAUTO CHANGES FROMUPDATE THE PAGECONTENT ANDTHROUGH MERGETHE THEM BACK INTO SERVOY SOURCE{hiddenDOC GENERATOR{div}
{sub-sectiondiv:id=description|text=}{sub-sectiondiv}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#CROP]
Constant used when setting the media option for components which display images.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#ENLARGE]
Constant used when setting the media option for components which display images.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#KEEPASPECT]
Constant used when setting the media option for components which display images.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#REDUCE]
Constant used when setting the media option for components which display images.{td}{tr}{tbody}{table}\\ 

{table:id=constant|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=CROP|class=node}{tr:id=name}{td}h6.CROP{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:CROP_des|trigger=button|text=}{sub-section}{sub-section:CROP_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:CROP_snc|trigger=button|text=}{sub-section}{sub-section:CROP_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:CROP_prs|trigger=button|text=}{sub-section}{sub-section:CROP_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:CROP_ret|trigger=button|text=}{sub-section}{sub-section:CROP_ret|trigger=none|div:class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CROP_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CROP_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CROP_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CROP_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CROP_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:CROP_sam|trigger=none}{code:language=javascript}
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.
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=ENLARGE|class=node}{tr:id=name}{td}h6.ENLARGE{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:ENLARGE_des|trigger=button|text=}{sub-section}{sub-section:ENLARGE_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:ENLARGE_snc|trigger=button|text=}{sub-section}{sub-section:ENLARGE_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:ENLARGE_prs|trigger=button|text=}{sub-section}{sub-section:ENLARGE_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:ENLARGE_ret|trigger=button|text=}{sub-section}{sub-section:ENLARGE_ret|trigger=none|div:class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:ENLARGE_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:ENLARGE_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:ENLARGE_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:ENLARGE_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:ENLARGE_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:ENLARGE_sam|trigger=none}{code:language=javascript}
var smallBytes = plugins.file.readFile('d:/small.jpg');
var smallImage = solutionModel.newMedia('small.jpg', smallBytes);
var bigLabelWithSmallImageEnlargeKeepAspect = form.newLabel('', 10, 70, 200, 100);
bigLabelWithSmallImageEnlargeKeepAspect.imageMedia = smallImage;
bigLabelWithSmallImageEnlargeKeepAspect.background = 'yellow';
bigLabelWithSmallImageEnlargeKeepAspect.mediaOptions = SM_MEDIAOPTION.ENLARGE | SM_MEDIAOPTION.KEEPASPECT;
var bigLabelWithSmallImageEnlargeNoAspect = form.newLabel('', 10, 180, 200, 100);
bigLabelWithSmallImageEnlargeNoAspect.imageMedia = smallImage;
bigLabelWithSmallImageEnlargeNoAspect.background = 'yellow';
bigLabelWithSmallImageEnlargeNoAspect.mediaOptions = SM_MEDIAOPTION.ENLARGE;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=KEEPASPECT|class=node}{tr:id=name}{td}h6.KEEPASPECT{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:KEEPASPECT_des|trigger=button|text=}{sub-section}{sub-section:KEEPASPECT_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:KEEPASPECT_snc|trigger=button|text=}{sub-section}{sub-section:KEEPASPECT_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:KEEPASPECT_prs|trigger=button|text=}{sub-section}{sub-section:KEEPASPECT_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:KEEPASPECT_ret|trigger=button|text=}{sub-section}{sub-section:KEEPASPECT_ret|trigger=none|div:class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:KEEPASPECT_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:KEEPASPECT_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:KEEPASPECT_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:KEEPASPECT_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:KEEPASPECT_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:KEEPASPECT_sam|trigger=none}{code:language=javascript}
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 smallLabelWithBigImageReduceKeepAspect = form.newLabel('', 10, 10, 50, 50);
smallLabelWithBigImageReduceKeepAspect.imageMedia = bigImage;
smallLabelWithBigImageReduceKeepAspect.background = 'yellow';	
smallLabelWithBigImageReduceKeepAspect.mediaOptions = SM_MEDIAOPTION.REDUCE | SM_MEDIAOPTION.KEEPASPECT;
var bigLabelWithSmallImageEnlargeKeepAspect = form.newLabel('', 10, 70, 200, 100);
bigLabelWithSmallImageEnlargeKeepAspect.imageMedia = smallImage;
bigLabelWithSmallImageEnlargeKeepAspect.background = 'yellow';
bigLabelWithSmallImageEnlargeKeepAspect.mediaOptions = SM_MEDIAOPTION.ENLARGE | SM_MEDIAOPTION.KEEPASPECT;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=REDUCE|class=node}{tr:id=name}{td}h6.REDUCE{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:REDUCE_des|trigger=button|text=}{sub-section}{sub-section:REDUCE_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:REDUCE_snc|trigger=button|text=}{sub-section}{sub-section:REDUCE_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:REDUCE_prs|trigger=button|text=}{sub-section}{sub-section:REDUCE_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:REDUCE_ret|trigger=button|text=}{sub-section}{sub-section:REDUCE_ret|trigger=none|div:class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:REDUCE_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:REDUCE_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:REDUCE_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:REDUCE_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:REDUCE_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:REDUCE_sam|trigger=none}{code:language=javascript}
var bigBytes = plugins.file.readFile('d:/big.jpg');
var bigImage = solutionModel.newMedia('big.jpg', bigBytes);
var smallLabelWithBigImageReduceKeepAspect = form.newLabel('', 10, 10, 50, 50);
smallLabelWithBigImageReduceKeepAspect.imageMedia = bigImage;
smallLabelWithBigImageReduceKeepAspect.background = 'yellow';	
smallLabelWithBigImageReduceKeepAspect.mediaOptions = SM_MEDIAOPTION.REDUCE | SM_MEDIAOPTION.KEEPASPECT;
var smallLabelWithBigImageReduceNoAspect = form.newLabel('', 70, 10, 50, 50);
smallLabelWithBigImageReduceNoAspect.imageMedia = bigImage;
smallLabelWithBigImageReduceNoAspect.background = 'yellow';	
smallLabelWithBigImageReduceNoAspect.mediaOptions = SM_MEDIAOPTION.REDUCE;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}