Media_TResize( xDim ; yDim )
Media_TResize allows you to resize an image to a target size when you next call Media_TApply.
Parameter | Description |
---|---|
xDim | Horizontal dimensions in pixels. |
yDim | Vertical dimensions in pixels. |
This function is similar to Media_TScale, but instead of scaling the image to a fractional size of the original, you can specify exact target dimensions, horizontally, vertically, or both.
If you specify one dimension as zero, the image will be resized to keep the same proportions. For example, if the source image is 200 x 300, and you specify Media_TResize(100; 0), the image will automatically be resized to 100 x 150.
When using Media_TResize in conjunction with the Media_TCrop transformation, the crop function will be performed first. In other words, in that case it is the cropped image that will be resized. If you are getting confusing results, it may be best to use Media_TApply separately with each function.
Activated by Media_TApply.
Returns
Empty string.
Examples
To resize an image to exactly 300 x 250 pixels:
Set Field [ MyTable::Response ; Media_TClear ]
Set Field [ MyTable::Response;
Media_TResize ( 300 ; 250 ) ]
Set Field [ MyTable::Picture Result;
Media_TApply ( MyTable::Picture 1 ) ]
To resize an image to a width of 300 pixels, keeping the image in proportion:
Set Field [ MyTable::Response ; Media_TClear ]
Set Field [ MyTable::Response;
Media_TResize ( 300 ; 0 ) ]
Set Field [ MyTable::Picture Result;
Media_TApply ( MyTable::Picture 1 ) ]