Child pages
  • MEDIAOPTION

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary

...

Table Cell (td)
Number

...

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 AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Divcache
styleindexdisplay:none

...

iddescription

...

Table Cell (td)
Number

...

true
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.

...

...

Table Cell (td)
Number

...

Constant used when setting the media option for components which display images.

...

...

Table Cell (td)
Number

...

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

...

servoy sDetail

...

padding0px
width100%

...

2100%height:30px

...

colspan1

...

2Constants Details

...

CROP

...

name

...

CROP

...

des

...

sIndent
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.

...

ret

...

Returns

...

sIndentclients

...

Supported Clients

sIndent

...

idsam
SmartClient,WebClient,NGClientsam

Sample

...

classsIndent

...

languagejavascript

...

sIdentjavascriptlastDetailRowENLARGEname

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.

...

classlastDetailRow

...

idENLARGE
Table Row (tr)
idname
Table Cell (td)
ENLARGE
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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.

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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;

...

classlastDetailRow

...

idKEEPASPECT
Table Row (tr)
idname
Table Cell (td)
KEEPASPECT
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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;

...

classlastDetailRow

...

idREDUCE
Table Row (tr)
idname
Table Cell (td)
REDUCE
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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.

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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;

...

classlastDetailRow

...

 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.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
KEEPASPECTname

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.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
REDUCEname

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.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow