Child pages
  • MEDIAOPTION

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{hidden} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden} {sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{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:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=97D1E576-59A1-48A7-938D-48A13C10C838}{tr:id=name}{td}h6.CROP{td}{tr}{tr:id=des}{td}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_des|text=|trigger=button}{sub-section}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_des|trigger=none|class=sIndent}
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Constants SummaryConstant used when setting the media option for components which display images.Constant used when setting the media option for components which display images.Constant used when setting the media option for components which display images.Constant used when setting the media option for components which display images.

constantservoy sDetail2100%height:30px2Constants DetailsCROPname

CROP

dessIndent
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.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_ret|text=|trigger=button}{sub-section}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_see|text=|trigger=button}{sub-section}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_see|text=|trigger=button}{sub-section}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_sam|text=|trigger=button}{sub-section}{sub-section:97D1E576-59A1-48A7-938D-48A13C10C838_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=50C3F154-5AE8-4FEF-8649-DC6950C967C0}{tr:id=name}{td}h6.ENLARGE{td}{tr}{tr:id=des}{td}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_des|text=|trigger=button}{sub-section}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_des|trigger=none|class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowENLARGEname

ENLARGE

dessIndent
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.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_ret|text=|trigger=button}{sub-section}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_see|text=|trigger=button}{sub-section}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_see|text=|trigger=button}{sub-section}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_sam|text=|trigger=button}{sub-section}{sub-section:50C3F154-5AE8-4FEF-8649-DC6950C967C0_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5F50F73C-AD08-4109-B9F2-DCD14E459E36}{tr:id=name}{td}h6.KEEPASPECT{td}{tr}{tr:id=des}{td}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_des|text=|trigger=button}{sub-section}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_des|trigger=none|class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowKEEPASPECTname

KEEPASPECT

dessIndent
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.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_ret|text=|trigger=button}{sub-section}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_see|text=|trigger=button}{sub-section}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_see|text=|trigger=button}{sub-section}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_sam|text=|trigger=button}{sub-section}{sub-section:5F50F73C-AD08-4109-B9F2-DCD14E459E36_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65}{tr:id=name}{td}h6.REDUCE{td}{tr}{tr:id=des}{td}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_des|text=|trigger=button}{sub-section}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_des|trigger=none|class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowREDUCEname

REDUCE

dessIndent
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.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_ret|text=|trigger=button}{sub-section}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_see|text=|trigger=button}{sub-section}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_see|text=|trigger=button}{sub-section}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_sam|text=|trigger=button}{sub-section}{sub-section:F4065DA2-FCEE-4BFA-B6AF-3F0E415CBC65_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow